(no title)
frodowtf | 2 years ago
Throwing an exception implicitly delegates error handling back to the caller, but they are not even notified about it. (talking about OCaml)
frodowtf | 2 years ago
Throwing an exception implicitly delegates error handling back to the caller, but they are not even notified about it. (talking about OCaml)
nextaccountic|2 years ago
Some frameworks catch panics automatically. For example, in the Actix web framework, if you panic in an HTTP response the panic will be catchee, so it won't bring the whole server down.
Also, by default a panic will terminate only the current thread, which is a major footgun: you now need to reason about what you program will do after some bug or unforseen circunstance happened somewhere in the code and made you program misbehave. Which leads to slightly insane things like lock poisoning.
It's more sane to compile with panic=abort, but that's not the default and it means that on panic you won't release resources (which aren't just allocated memory to be clear)