mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
chore: re-order backend file structure
This commit is contained in:
8
apps/server/src/utils/errors.ts
Normal file
8
apps/server/src/utils/errors.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { ConflictError } from "http-errors-enhanced";
|
||||
|
||||
export const handleServiceError = (error: unknown) => {
|
||||
if (error instanceof ConflictError) {
|
||||
return { message: error.message, status: 409 as const };
|
||||
}
|
||||
return { message: "Internal Server Error", status: 500 as const };
|
||||
};
|
||||
Reference in New Issue
Block a user