

5 Great Resources for Exception Handling Best Practices in Java · GitHub
source link: https://gist.github.com/raineorshine/5521119
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

General Tip
"The trick is to catch exceptions at the proper layer, where your program can either meaningfully recover from the exception and continue without causing further errors, or provide the user with specific information, including instructions on how to recover from the error. When it is not practical for a method to do either of these, simply let the exception go so it can be caught later on and handled at the appropriate level."
Resources
Advantages of Exceptions
Excellent example of separating error-handling code from program logic
Three Rules for Effective Exception Handling
Longer explanation and case study of exception use, including the basic principles of "throw early" and "catch late". Clear and thorough.
Java Tutorials: Exceptions
A well-organized series of tutorials about what exceptions are and how to use them.
Exception Handling Antipatterns
Some precise examples of incorrect usage of exceptions.
Best Practices for Exception Management
Most of the above resources for found in this excellent Stack Overflow question.
Recommend
-
59
Kotlin - Try type for functional exception handling Scala has a Try type to functionally handle exceptions. I could get my head around using this typ...
-
55
-
139
This is a continuation of our series on exception handling and validation in Spring Boot REST APIs. Inearlier posts, we discussed a robust pattern for exception handling and validation in Spring Boot and MVC REST Web Ser...
-
50
One of the most common things that I have seen developers working with ASP.NET Core struggle with, is the way to centrally and consistently handle application errors and input validation. Those seemingly different topics...
-
52
Handling Exceptions in Java is one of the fundamental things a developer should be experienced in - handling them is as important as the rest of the co...
-
32
Overview Handling Exceptions in Java is one of the most basic and fundamental things a developer should know by heart. Sadly, this is often overlooked and the importance of exception handling is underestimated - it's as important as the rest of...
-
41
Basically, an Error is used by the Java run-time system (JVM) to indicate errors that are associated with the run-time envi...
-
40
Oh no, don't do this to me... // Writing comment that exception is skipped try { throw new IOException("Made up"); } catch (IOException e) { // skip it } // Logging and moving on try { throw new IO...
-
8
JavaScript Exception Handling: Patterns & Best PracticesLearn how to handle JavaScript Exceptions the right wayOver the past few years, JavaScript has emerged as a leading programing langu...
-
6
In this comprehensive guide, we’ll dive deep into the world of C# exception handling. We’ll cover everything from the basics to advanced techniques, along with best practices to help you write clean, robust, and maintainable code. So, let’s get st...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK