ciallo-problem

    RFC 9457 Problem Details fluent builder and #callsite causal error chains for unmbt/ciallo

    problem-details
    rfc9457
    error
    http
    ciallo
    Download zip
    Author
    Version
    0.1.1
    License
    MIT
    Last updated
    13 hours ago
    Downloads
    8

    #unmbt/ciallo-problem

    RFC 9457 (application/problem+json) fluent ProblemBuilder and #callsite(autofill(loc)) causal error chains for unmbt/ciallo.

    ErrorFrame

    pub(all) struct ErrorFrame {
    code : String
    message : String
    source_loc : String?
    } derive(Eq,
    Debug
    )

    ProblemBuilder

    pub struct ProblemBuilder {
    status : Int
    type_uri : String
    title : String
    detail : String
    code : String
    instance : String?
    trace_id : String?
    source_loc : SourceLoc?
    issues : Array[
    ValidationIssue
    ]
    extensions : Map[String,
    Json
    ]
    chain : Array[ErrorFrame]
    }

    Fluent RFC 9457 Problem Details builder with #callsite causal error chain.

    ProblemBuilder::ProblemBuilder

    #callsite(autofill(loc))
    fn ProblemBuilder::ProblemBuilder(status~ : Int, code~ : String, detail? : String, title? : String, type_uri? : String, loc~ : SourceLoc) -> ProblemBuilder

    ProblemBuilder::build

    ProblemBuilder::causes

    ProblemBuilder::into_http_error

    ProblemBuilder::to_response

    fn ProblemBuilder::to_response(self : ProblemBuilder, debug? : Bool) ->
    Response

    ProblemBuilder::with_cause

    #callsite(autofill(loc))
    fn ProblemBuilder::with_cause(self : ProblemBuilder, code~ : String, message~ : String, loc~ : SourceLoc) -> ProblemBuilder

    Appends a causal error frame capturing the caller's #callsite location. Causal chains are emitted only when debug=true to prevent internal leakage.

    ProblemBuilder::with_detail

    fn ProblemBuilder::with_detail(self : ProblemBuilder, detail : String) -> ProblemBuilder

    ProblemBuilder::with_extension

    fn ProblemBuilder::with_extension(self : ProblemBuilder, key : String, value :
    Json
    ) -> ProblemBuilder

    ProblemBuilder::with_instance

    fn ProblemBuilder::with_instance(self : ProblemBuilder, instance : String) -> ProblemBuilder

    ProblemBuilder::with_title

    fn ProblemBuilder::with_title(self : ProblemBuilder, title : String) -> ProblemBuilder

    ProblemBuilder::with_trace_id

    fn ProblemBuilder::with_trace_id(self : ProblemBuilder, trace_id : String) -> ProblemBuilder

    ProblemBuilder::with_type

    fn ProblemBuilder::with_type(self : ProblemBuilder, uri : String) -> ProblemBuilder

    conflict

    #callsite(autofill(loc))
    fn conflict(detail : String, code? : String, loc~ : SourceLoc) -> ProblemBuilder

    gateway_timeout

    #callsite(autofill(loc))
    fn gateway_timeout(detail : String, code? : String, loc~ : SourceLoc) -> ProblemBuilder

    service_unavailable

    #callsite(autofill(loc))
    fn service_unavailable(detail : String, code? : String, loc~ : SourceLoc) -> ProblemBuilder

    Source Files