mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
* refactor: unify backend and frontend servers * refactor: correct paths for openapi & drizzle * refactor: move api-client to client * fix: drizzle paths * chore: fix linting issues * fix: form reset issue
12 lines
254 B
TypeScript
12 lines
254 B
TypeScript
export const parseError = (error?: unknown) => {
|
|
if (error && typeof error === "object" && "message" in error) {
|
|
return { message: error.message as string };
|
|
}
|
|
|
|
if (typeof error === "string") {
|
|
return { message: error };
|
|
}
|
|
|
|
return undefined;
|
|
};
|