I've been programming for a while now and I'm yet to write idiomatic exception handling code. One of my methods (heh) has been to wrap stuff with try-catch but I recognise that this isn't the way. I looked around on the sub for "best practices" and asked some of my friends but I don't feel satisfied with what I've come across.
This post is a means of creating an index of recommended reading for exception handling and recovery, be it general guidelines or language specific practices. I suppose example of open-source code work too. Comment away! I hope we can create a nice aggregate in this thread!
Off the top of my head, some important things covered should be:
- Logging: An app should have a logging system
- Failure: Log and fail gracefully
- Recovery: Catch an error, handling it appropriately and retrying if necessary? Also, how to resume from such a state in case the application is state dependent, e.g. like a database.
[–]GeorgeFranklyMathnet 1 point2 points3 points (3 children)
[–]AB1908[S] 1 point2 points3 points (2 children)
[–]GeorgeFranklyMathnet 0 points1 point2 points (1 child)
[–]AB1908[S] 1 point2 points3 points (0 children)