Repository navigation
feat(Reporter): add discontinue_with_fatal - #201
Conversation
89183cd to
760dec8
Compare
|
@mikeshulman Thanks! Good catch. The only other name that comes to mind is |
Co-authored-by: favonia <favonia@gmail.com>
Co-authored-by: favonia <favonia@gmail.com>
Co-authored-by: favonia <favonia@gmail.com>
Co-authored-by: favonia <favonia@gmail.com>
Co-authored-by: favonia <favonia@gmail.com>
|
I did think of that, but decided against it. I agree that |
|
But of course the final decision is yours! |
|
@mikeshulman I've also been considering |
|
I think that would be okay too. The extra 5 characters aren't terrible, and it might be clearer. I could go either way. Another option, of course, would be to actually expose the exception and effect names, so the user could just call |
|
Another point for exposing exceptions is that (at least, according to both Gemini and Claude, and their explanation makes sense to me) effect handlers are substantially slower than exception handlers. So if a user only wants to catch fatal errors and not emit-diagnostics, having to use |
|
Or rewrite |
|
@mikeshulman I will use |
Asai fatal errors are represented internally as exceptions, but the wrapper exception
Fatalis not exposed outside Asai. This works fine as long as the only things you want to do with a fatal exception are raise it (withfatal) or catch it (withrunandtry_with), but in the presence of effects there is something else we can do with an exception: we can discontinue a continuation. This PR adds adiscontinue_fatalfunction that creates a diagnostic wrapped in an exception just likefatal, but then passes it todiscontinuerather thanraise. (I admitdiscontinue_fatalisn't the snappiest name, but I couldn't think of a better one.)