(error: unknown)
| 78 | * unrecognized and the caller should log it and return its generic 500. |
| 79 | */ |
| 80 | export function rowWriteErrorResponse(error: unknown): NextResponse | null { |
| 81 | const message = rootErrorMessage(error) |
| 82 | |
| 83 | if (ROW_WRITE_ERROR_PATTERNS.some((p) => message.includes(p)) || /^Row .+?:/.test(message)) { |
| 84 | return NextResponse.json({ error: message }, { status: 400 }) |
| 85 | } |
| 86 | |
| 87 | return null |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * Next.js buffers the request body for the proxy and silently truncates it past this |
no test coverage detected