Skip to content

Commit

Permalink
fix(api_adresse): dont log 504
Browse files Browse the repository at this point in the history
  • Loading branch information
OCTO-CLEM committed Dec 7, 2022
1 parent adb93da commit fd38799
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ interface ApiAdresseErrorResponse {
export function handleGetFailureError(e: unknown, context: string) {
if (axios.isAxiosError(e)) {
const error: AxiosError<ApiAdresseErrorResponse> = e as AxiosError<ApiAdresseErrorResponse>;
if(error.response?.status === 400 && (<AxiosResponse<{ message: string }>> e?.response)?.data?.message === 'Le format de l’id de l’adresse recherchée est incorrect.') {
if (error.response?.status === 400 && (<AxiosResponse<{ message: string }>>e?.response)?.data?.message === 'Le format de l’id de l’adresse recherchée est incorrect.') {
return createFailure(ErreurMétier.DEMANDE_INCORRECTE);
} if(error.response?.status === 504) {
return createFailure(ErreurMétier.SERVICE_INDISPONIBLE);
} else {
LoggerService.warnWithExtra(
new SentryException(
Expand Down

0 comments on commit fd38799

Please sign in to comment.