Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you want to handle the assert cases, you should not use the asserts in the first place.


That isn't possible. The assert may not even be produced in code you control.

The reason panics/exceptions exist is it is too onerous to handle every possible error condition at all callsites (allocation failure and broken pipes are the famous examples), and it is not possible to enumerate all possible error conditions (unintentional programmer errors for example).

People have religious ideas about handling panics for some reason.


Panics shouldn't exist in modern Rust (if there is such a thing) at all.


I take it you mean panics should always abort?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: