Skip to content

Conversation

@emmiegit
Copy link
Member

@emmiegit emmiegit commented Jan 23, 2026

This uses the [exn] crate to

as described in

Example error response:

[1001] method 'user_create' failed, at src/api.rs:378:5
|
|-> [1008] failed to create user, at src/endpoints/user.rs:37:10
|
|-> [4101] cannot create user with empty slug, at src/services/user/service.rs:931:9

With the error JSON itself being:

{
    "code": 4101,
    "message": "User slug cannot be empty",
    "data": {
        "call_trace": "[1001] method 'user_create' failed, at src/api.rs:378:5\n|\n|-> [1008] failed to create user, at src/endpoints/user.rs:37:10\n|\n|-> [4101] cannot create user with empty slug, at src/services/user/service.rs:931:9",
        "code_trace": [
            1001,
            1008,
            4101
        ],
        "extra": null
    }
}

This should produce very nice error messages that show
the relevant code path and assist with debugging.
Contains the basic string line for the kind of error previously simply
rendered via Display using thiserror.
Now the new one is default, and all the prior uses are
OldError, OldResult, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants