Common HTTP utilities: error responses in the one error shape
(wagoe.platform.core.http.errors) and health checks.
The pure transformations are in wagoe.platform.core.http.problem-details.
Common HTTP utilities: error responses in the one error shape (`wagoe.platform.core.http.errors`) and health checks. The pure transformations are in wagoe.platform.core.http.problem-details.
(create-method-not-allowed-handler allowed-methods)Create a standardized 405 Method Not Allowed handler.
Args: allowed-methods: Collection of allowed HTTP methods
Returns: Ring handler function for 405 responses
Create a standardized 405 Method Not Allowed handler. Args: allowed-methods: Collection of allowed HTTP methods Returns: Ring handler function for 405 responses
(create-not-found-handler)Create a standardized 404 Not Found handler.
Returns: Ring handler function for 404 responses
Create a standardized 404 Not Found handler. Returns: Ring handler function for 404 responses
Default mapping of exception types to HTTP status codes and titles.
Re-exported from core for backward compatibility.
Default mapping of exception types to HTTP status codes and titles. Re-exported from core for backward compatibility.
(exception->problem ex correlation-id uri)(exception->problem ex correlation-id uri error-mappings)Convert exception to an error response in the one error shape.
Args: ex: Exception to convert correlation-id: Request correlation ID uri: Request URI error-mappings: Optional custom error type mappings (overrides defaults)
Returns: Ring response map
Convert exception to an error response in the one error shape. Args: ex: Exception to convert correlation-id: Request correlation ID uri: Request URI error-mappings: Optional custom error type mappings (overrides defaults) Returns: Ring response map
(health-check-handler service-name)(health-check-handler service-name version)(health-check-handler service-name version additional-checks)Create a generic health check handler.
Args: service-name: Name of the service version: Service version (optional) additional-checks: Optional function that returns additional health data
Returns: Ring handler function for health checks
Create a generic health check handler. Args: service-name: Name of the service version: Service version (optional) additional-checks: Optional function that returns additional health data Returns: Ring handler function for health checks
(readiness-handler db-context cache)Create a readiness check handler that verifies dependency health.
Checks database and (optionally) cache connectivity. Returns 200 when all components are healthy, 503 when any component is down.
Args: db-context: Database context (required) cache: Cache component (optional, nil if not configured)
Returns: Ring handler function for readiness checks
Create a readiness check handler that verifies dependency health. Checks database and (optionally) cache connectivity. Returns 200 when all components are healthy, 503 when any component is down. Args: db-context: Database context (required) cache: Cache component (optional, nil if not configured) Returns: Ring handler function for readiness checks
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |