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

Who uses panic instead of `?` and anyhow / Box<dyn Error> (error propagation?)

I think there is even a (gross) way to achieve try/catch around a block of code that panics?



Yeah, panic/assert is only for Things That Really Shouldn’t Ever Fail, If They Do Our Base Assumptions Have Broken.

whereas Error is for things that are unlikely to fail, like network/filesystem requests and recoverable logic bugs.




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

Search: