CrossClj

2.0.0-alpha20 docs

SourceDocs



RECENT
    VARS
    http-response-handler
    mapped-exception-types
    request-parsing-handler
    request-validation-handler
    response-validation-handler
    safe-handler
    schema-error-handler
    with-logging

    « Index of all namespaces of this project

    (http-response-handler _ {:keys [response]} _)
    reads response from ex-data :response
    
    (request-parsing-handler ex data req)
    (request-validation-handler e data req)
    Creates error response based on Schema error. The following keys are available:
    
    :type            type of the exception (::request-validation)
    :coercion        coercion instance used
    :value           value that was validated
    :in              location of the value (e.g. [:request :query-params])
    :schema          schema to be validated against
    :error           schema error
    :request         raw request
    (response-validation-handler e data req)
    Creates error response based on a response error. The following keys are available:
    
    :type            type of the exception (::response-validation)
    :coercion        coercion instance used
    :in              location of the value ([:response :body])
    :schema          schema to be validated against
    :error           schema error
    :request         raw request
    :response        raw response
    (safe-handler e data req)
    Writes :error to log with the exception message & stacktrace.
    
    Error response only contains class of the Exception so that it won't accidentally
    expose secret details.
    (schema-error-handler e data req)
    Creates error response based on Schema error.
    
    (with-logging handler)(with-logging handler log-level)
    Wrap compojure-api exception-handler a function which will log the
    exception message and stack-trace with given log-level.