️ Error → HTTP Status Code Convention
The source generators use convention-based name matching to determine HTTP status codes automatically. No configuration needed for the common cases:
| Error Name Pattern | HTTP Status | Examples |
|---|---|---|
*NotFound*, *DoesNotExist*, *Missing* |
404 | UserNotFoundError, RecordMissingException |
*Validation*, *Invalid*, *Malformed* |
422 | ValidationError, InvalidInputException |
*Unauthorized*, *Unauthenticated* |
401 | UnauthorizedError, NotAuthenticatedException |
*Forbidden*, *AccessDenied* |
403 | ForbiddenError, AccessDeniedException |
*Conflict*, *Duplicate*, *AlreadyExists* |
409 | ConflictError, DuplicateResourceException |
*RateLimit*, *Throttle* |
429 | RateLimitError, ThrottleException |
*Timeout*, *TimedOut* |
408 | TimeoutError, RequestTimedOutException |
| (default) | 400 | Any other error type |
For non-convention errors use IError.Tags["HttpStatusCode"] or SmartEndpoints' [SmartFilter] for explicit mapping.