refactor: gestion des erreurs

This commit is contained in:
Luc SORIGNET
2025-03-01 17:52:47 +01:00
parent d1a0067f7b
commit f3490a4e95
14 changed files with 136 additions and 38 deletions

View File

@ -17,7 +17,7 @@ const requestResponseHandler = async (response) => {
return body;
}
// Throw an error with the JSON body containing the form errors
const error = new Error('Form submission error');
const error = new Error(body?.errorMessage || "Une erreur est survenue");
error.details = body;
throw error;
}