(error: unknown)
| 53 | export const isServerError = (error: unknown): boolean => toHttpResponseError(error).status >= 500; |
| 54 | |
| 55 | export const toErrorResponse = (error: unknown): Response => { |
| 56 | const mapped = toHttpResponseError(error); |
| 57 | if (mapped.status >= 500) captureCause(mapped); |
| 58 | return Response.json({ error: mapped.message, code: mapped.code }, { status: mapped.status }); |
| 59 | }; |
| 60 | |
| 61 | export const toErrorServerResponse = (error: unknown): HttpServerResponse.HttpServerResponse => { |
| 62 | const mapped = toHttpResponseError(error); |
nothing calls this directly
no test coverage detected