mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-14 17:06:39 +00:00
refactor and reorganize
This commit is contained in:
8
src/lib/api/formatAxiosError.ts
Normal file
8
src/lib/api/formatAxiosError.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export function formatAxiosError(error: any, defaultMessage?: string): string {
|
||||
return (
|
||||
error.response?.data?.message ||
|
||||
error?.message ||
|
||||
defaultMessage ||
|
||||
"An error occurred"
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user