A lisp-backed error crate for rust?
What if errors were executable?
That’s the question I set out to answer. Imagine if you could just give errors access to the program state and include a debugger to de-bug and fix the error. What if you could repair a broken auth flow by signing the user in again, using code within the error to do so?
Now, I don’t profess that this is a particularly good idea. Most of it can be accomplished by embedding javascript into the page that does the fix same as the error would—-that’s what would execute the error code, anyway.
But along the way I discovered something: S-Expressions are particularly readable for error handling, serialize well across service boundaries where they deserialize on the other size, and they offer ample opportunity to pattern match on a topological minor of the error.
Good idea? Bad idea?
Anecdotally, I love this format because I can annotate errors flexibly and process them programatically.
Not sure I want to link to what I did.