(
result: { ok: false; status: 404 | 403 },
requestId: string,
context?: string
)
| 200 | } |
| 201 | |
| 202 | export function accessError( |
| 203 | result: { ok: false; status: 404 | 403 }, |
| 204 | requestId: string, |
| 205 | context?: string |
| 206 | ): NextResponse { |
| 207 | const message = result.status === 404 ? 'Table not found' : 'Access denied' |
| 208 | logger.warn(`[${requestId}] ${message}${context ? `: ${context}` : ''}`) |
| 209 | return NextResponse.json({ error: message }, { status: result.status }) |
| 210 | } |
| 211 | |
| 212 | /** |
| 213 | * Converts a TableAccessDenied result to an appropriate HTTP response. |
no test coverage detected