mirror of
https://github.com/bitbaum/botsmann.git
synced 2026-12-04 06:08:38 +01:00
- Add @~/.claude/CLAUDE.md import for global engineering standards - Update Last Updated date to 2026-01-23 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
31 lines
515 B
TypeScript
31 lines
515 B
TypeScript
export type ErrorCode =
|
|
| 'UNAUTHORIZED'
|
|
| 'VALIDATION_ERROR'
|
|
| 'RATE_LIMIT'
|
|
| 'DATABASE_ERROR'
|
|
| 'INTERNAL_ERROR'
|
|
| 'NOT_FOUND';
|
|
|
|
export interface ErrorDetail {
|
|
field?: string;
|
|
message: string;
|
|
}
|
|
|
|
export interface ErrorResponse {
|
|
error: string;
|
|
code: ErrorCode;
|
|
details?: ErrorDetail[];
|
|
}
|
|
|
|
export function createErrorResponse(
|
|
message: string,
|
|
code: ErrorCode,
|
|
details?: ErrorDetail[],
|
|
): ErrorResponse {
|
|
return {
|
|
error: message,
|
|
code,
|
|
...(details && { details }),
|
|
};
|
|
}
|