Skip to content

Instantly share code, notes, and snippets.

View hywak's full-sized avatar
🤞

Michał Baran hywak

🤞
View GitHub Profile
@dreynaud
dreynaud / error-handling.md
Last active November 15, 2024 03:31
Error Handling in Practice

Error Handling in Practice

My experience is mostly with Java backend services in the cloud, so the advice in this post will almost certainly be biased towards this kind of error handling. But hopefully, some of it will be generally applicable and help you maintain and debug your programs in the long run.

I don't claim that these are universal best practices, but I have found these to be useful as general guidelines. As always, use your best judgment and do things that make sense in your context.

Log the whole thing

In Java, a full exception is: