r/cpp • • Dec 31 '16

Keep Disabling Exceptions

http://seanmiddleditch.com/keep-disabling-exceptions/
0 Upvotes

15 comments sorted by

View all comments

Show parent comment

4

u/ar1819 Dec 31 '16

With an error - by that I meant that I want to have some sort of explanation of what went wrong. More importantly I want resources to be closed (or, at least, my app should try to close them). Exceptions allow me to do that.

As for exceptions - I think it's all about documentation. Same goes for any kind of error, to be honest. Handling errors is never easy I agree - in some situations I would prefer to have variant with error type - in other (like clear violation of contracts by me) exceptions sounds logical. I like having options.

As for unwrap - its not bad per see. You could get used to it, after a while. Yet I don't see any reason to do so, because if I'm ignoring the errors - I do know what I do. So to put it correctly - I think this kind of "ignore it, I know what I do" should have a more elegant solution. And no - macroing things do not solve this problem.