Files
workavia-calendar-front/src/utils/errorUtils.ts
T
Camille Moussu 42f5d8e1a9 #204 Error management (#237)
* added error snackbar for api fails
* improved error page to be shown only for userdata errors and to allow retrying
* fixed test breaking only in local because of timezone and reduced warnings for easier reading of tests results
* added error management for failure inside calendars imports
* added error snackbar for api fails
* improved error page to be shown only for userdata errors and to allow retrying
* added error management for failure inside calendars imports

Co-authored-by: Camille Moussu <cmoussu@linagora.com>
2025-10-27 11:23:38 +01:00

10 lines
295 B
TypeScript

export function formatReduxError(error: unknown): string {
if (!error) return "Unknown error";
if (typeof error === "string") return error;
if (typeof error === "object") {
const err = error as any;
if (err?.message) return err.message;
}
return "Unexpected error occurred";
}