chore: update various components and services for improved functionality and consistency, including formatting adjustments and minor refactors
This commit is contained in:
@@ -7,17 +7,16 @@ import { ERROR_CODES } from "@/constants/errorCodes";
|
||||
*/
|
||||
export function findHttpStatus(error: unknown): number | null {
|
||||
if (!(error instanceof AppError)) return null;
|
||||
|
||||
|
||||
// Si c'est une erreur HTTP, récupérer le status
|
||||
if (error.code === ERROR_CODES.KOMGA.HTTP_ERROR) {
|
||||
return (error.params as any)?.status || null;
|
||||
}
|
||||
|
||||
|
||||
// Sinon, chercher récursivement dans originalError
|
||||
if (error.originalError) {
|
||||
return findHttpStatus(error.originalError);
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user