Sign in

    rinnein/moonata/error does not have a README file

    JsonataError

    pub(all) suberror JsonataError {
    SyntaxError(message~ : String, position~ : Int?, token~ : String?)
    RuntimeError(message~ : String)
    TypeError(message~ : String, expected~ : String?, actual~ : String?)
    SignatureError(message~ : String, func~ : String?)
    GuardrailError(message~ : String, limit~ : String?)
    } derive(Eq,
    Debug
    )

    JSONata 错误类型层级。

    单一 suberror,含 5 个变体。调用方用一次 raise JsonataError 即可传播所有错误, 需要精细处理时用模式匹配区分变体。每个变体携带结构化字段,便于定位。

    guardrail_error

    fn guardrail_error(message : String, limit? : String?) -> JsonataError

    便捷构造护栏错误。

    runtime_error

    fn runtime_error(message : String) -> JsonataError

    便捷构造运行时错误。

    signature_error

    fn signature_error(message : String, func? : String?) -> JsonataError

    便捷构造签名错误。

    syntax_error

    fn syntax_error(message : String, position? : Int?, token? : String?) -> JsonataError

    便捷构造语法错误。

    type_error

    fn type_error(message : String, expected? : String?, actual? : String?) -> JsonataError

    便捷构造类型错误。

    Source Files