Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Unified error classification system ensuring every error in the stack has a code, category, severity, and user-facing message. Bridges the FastAPI ErrorResponse model with the Next.js ApiClientError class.
Description
Provides a structured error code taxonomy following the DOMAIN_CATEGORY_SPECIFIC format. Maps every runtime error to an HTTP status code, severity level, and user-facing message, ensuring consistent error handling between the FastAPI backend and Next.js frontend.
When to Apply
Positive Triggers
Creating or modifying API error responses
Adding new HTTPException raises in FastAPI routes
Implementing frontend error handling or display
Designing error boundaries for React components
Reviewing error consistency across backend and frontend
User mentions: "error handling", "error codes", "error messages", "error response"
Map technical error codes to user-friendly messages:
constERROR_MESSAGES: Record<string, string> = {
AUTH_VALIDATION_INVALID_TOKEN: 'Your session has expired. Please sign in again.',
AUTH_VALIDATION_EXPIRED_TOKEN: 'Your session has expired. Please sign in again.',
AUTH_PERMISSION_DENIED: 'You do not have permission to perform this action.',
AUTH_PERMISSION_INACTIVE: 'Your account has been deactivated.',
DATA_VALIDATION_MISSING_FIELD: 'Please fill in all required fields.',
AGENT_RUNTIME_TIMEOUT: 'The AI agent took too long to respond. Please try again.',
AGENT_EXTERNAL_PROVIDER_DOWN: 'The AI service is temporarily unavailable.',
SYS_EXTERNAL_DATABASE: 'A database error occurred. Please try again later.',
SYS_RATELIMIT_EXCEEDED: 'Too many requests. Please wait a moment.',
};
exportfunctiongetUserMessage(error: ApiClientError): string {
returnERROR_MESSAGES[error.errorCode] ?? error.message;
}
Error Code Registry
Authentication Errors
Code
HTTP
Message
AUTH_VALIDATION_INVALID_TOKEN
401
Invalid authentication token
AUTH_VALIDATION_EXPIRED_TOKEN
401
Token has expired
AUTH_VALIDATION_MISSING_TOKEN
401
No authentication token provided
AUTH_PERMISSION_DENIED
403
Insufficient permissions
AUTH_PERMISSION_INACTIVE
403
Account is inactive
AUTH_PERMISSION_NOT_ADMIN
403
Admin access required
AUTH_NOTFOUND_USER
404
User not found
Agent Errors
Code
HTTP
Message
AGENT_RUNTIME_TIMEOUT
504
Agent execution timed out
AGENT_RUNTIME_FAILED
500
Agent execution failed
AGENT_EXTERNAL_PROVIDER_DOWN
503
AI provider unavailable
AGENT_VALIDATION_INVALID_INPUT
422
Invalid agent input
AGENT_NOTFOUND_TYPE
404
Unknown agent type
Data Errors
Code
HTTP
Message
DATA_VALIDATION_MISSING_FIELD
422
Required field missing
DATA_VALIDATION_INVALID_FORMAT
422
Invalid data format
DATA_NOTFOUND_DOCUMENT
404
Document not found
DATA_NOTFOUND_CONTRACTOR
404
Contractor not found
DATA_CONFLICT_DUPLICATE
409
Resource already exists
System Errors
Code
HTTP
Message
SYS_EXTERNAL_DATABASE
500
Database connection error
SYS_EXTERNAL_REDIS
500
Cache service error
SYS_RATELIMIT_EXCEEDED
429
Rate limit exceeded
SYS_RUNTIME_INTERNAL
500
Internal server error
Adding New Error Codes
When adding a new error code:
Choose domain from the Domains table
Choose category from the Categories table
Add specific identifier describing the failure
Register in the Error Code Registry table above
Map a user-facing message in the frontend ERROR_MESSAGES
Use the ErrorResponse model when raising HTTPException