refactor: handle thrown errors

This commit is contained in:
Carlos Valente
2024-10-27 10:00:15 +01:00
committed by Carlos Valente
parent b637621871
commit 3591b93c2d
+2
View File
@@ -23,6 +23,8 @@ export function maybeAxiosError(error: unknown) {
}
}
return `${statusText}: ${data}`;
} else if (error instanceof Error) {
return error.message;
} else {
if (typeof error !== 'string') {
return JSON.stringify(error);