Java Exception Handling
From MPDLMediaWiki
Revision as of 15:58, 17 September 2008 by
MFranke
(
talk
|
contribs
)
(
→Between modules, throw only generic exceptions (e.g. java.lang.Exception, java.lang.RuntimeException)
)
(
diff
)
← Older revision
|
Latest revision
(
diff
) |
Newer revision →
(
diff
)
Jump to navigation
Jump to search
Contents
1
Problem description
1.1
Modules need dependencies of other modules only because of their exception classes
1.2
Stacktraces are sometimes swallowed
1.3
Sometimes, excessive stacktraces are shown, even without useful information
1.4
Logger.error, System.out and e.printStackTrace are mixed up happily
1.5
No distinction between exceptions and errors
2
Conclusion
2.1
Distinguish between errors and exceptions
2.2
Inside a module, always throw errors up as they are
2.3
When catching exceptions, log appropriately
2.4
Between modules, throw only generic exceptions (e.g. java.lang.Exception, java.lang.RuntimeException) without cause
Problem description
Modules need dependencies of other modules only because of their exception classes
Stacktraces are sometimes swallowed
Sometimes, excessive stacktraces are shown, even without useful information
Logger.error, System.out and e.printStackTrace are mixed up happily
No distinction between exceptions and errors
Conclusion
Distinguish between errors and exceptions
Inside a module, always throw errors up as they are
When catching exceptions, log appropriately
Between modules, throw only generic exceptions (e.g. java.lang.Exception, java.lang.RuntimeException) without cause
Navigation menu
Personal tools
Log in
Request account
Namespaces
Page
Discussion
Variants
Views
Read
View source
View history
More
Search
About CoLab
Purpose
FAQ
Contact Us
Navigation
Main Page
Newest Pages
Recent Changes
All Categories
All Pages
Contents
Projects
Main Topics
Upcoming Events
Global Conferences
Help
Wiki Help
Wiki Syntax Basics
Glossary
Tools
What links here
Related changes
Special pages
Printable version
Permanent link
Page contributors
Page information