def default.error

bend-kit-camber@0.15.0.1 · camber.bend:674

import bend-kit-camber@0.15.0.1/camber.bend as Camber
import Base
import bend-kit-http@0.38.1.1/http.bend as Http

674def default.error(~E: Data, error: Error<E>) -> Http.Res:
675  match error:
676    case Framework{status, allow}:
677      match status:
678        case 400:
679          problem(400, "Bad Request", allow)
680        case 404:
681          problem(404, "Not Found", allow)
682        case 405:
683          problem(405, "Method Not Allowed", allow)
684        case 415:
685          problem(415, "Unsupported Media Type", allow)
686        case _:
687          minimal()
688    case _:
689      minimal()

Uses (8)

Used by (1)