Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppError ¶
type AppError struct {
Code int // HTTP status code (e.g., 404, 500)
Message string // User-facing safe message
Err error // Internal error (logged, never exposed in production)
}
AppError represents a structured application error with HTTP status context.
func Unprocessable ¶
Unprocessable creates a 422 error.
func (*AppError) ErrorResponse ¶
ErrorResponse returns a map for JSON error responses. In debug mode, it includes internal error details. In production, only the safe message.
Click to show internal directories.
Click to hide internal directories.