News for hackers. Stuff that matters.
Re:Elixir at PagerDuty by steveklabnik on Thursday June 14, 2018 @04:39PM (#17315167)
You're not wrong. The issue is, it's hard to make a good API for this; anything else is basically dealing with global state, and so you don't have a guarantee that something else doesn't re-set it to something else while unwinding is happening, etc. I do have one more thing to say on this, but it fits better in a reply elsewhere in the thread :)

panic! does return a non-zero exit code, but isn't really designed for good end-user output.

Re:Elixir at PagerDuty by rabidferret on Thursday June 14, 2018 @04:43PM (#17315203)
If you don't care about the specific error code as long as it's non-zero, just returning `Result<(), impl Debug>` does what you want on stable now, right?
Re:Elixir at PagerDuty by steveklabnik on Thursday June 14, 2018 @04:50PM (#17315255)
That's true, but then you have to juggle Results as your return type everywhere. It's probably a good idea overall, but some people don't want to do that. And yes, you don't get to pick the code. Yet!