2026-03-21 15:16:40 -04:00
2026-03-21 21:22:55 -04:00
2026-03-21 15:16:40 -04:00
2026-03-21 15:16:40 -04:00
2026-03-21 15:16:40 -04:00
2026-03-21 21:22:55 -04:00

Playground - Exn

Context aware errors.

Trying to get exn into structured output for tracing_subscriber.

https://github.com/fast/exn

https://fast.github.io/blog/stop-forwarding-errors-start-designing-them/

example default output:

the program died, at src/main.rs:35:34
|
|-> failed to create file: res/foo.txt, at src/main.rs:79:43
|
|-> Permission denied (os error 13), at src/main.rs:79:43

example structured output

{
  "fields": {
    "error": {
      "causes": [
        {
          "causes": [
            {
              "location": "src/main.rs:86:43",
              "message": "Permission denied (os error 13)"
            }
          ],
          "location": "src/main.rs:86:43",
          "message": "failed to create file: res/foo.txt"
        }
      ],
      "location": "src/main.rs:41:34",
      "message": "the program died"
    }
  },
  "level": "ERROR",
  "target": "playground_exn",
  "timestamp": "2026-03-22T01:19:11.256874822+00:00"
}```
Description
No description provided
Readme 47 KiB
Languages
Rust 100%