(error?: Record<string, any>)
| 48 | } |
| 49 | |
| 50 | export function notFound(error?: Record<string, any>) { |
| 51 | return Response.json( |
| 52 | { error: { message: 'Not found', code: 'not-found', status: 404, ...error } }, |
| 53 | { status: 404 }, |
| 54 | ); |
| 55 | } |
| 56 | |
| 57 | export function serverError(error?: unknown) { |
| 58 | if (error && typeof error !== 'string') { |