Mind map
Error Handling
Map content
Error Handling
all the programmers should do it
- making sure that our code does what it needs to do
it's important, but if it obscures logic, it's wrong
Use exceptions rather than return codes
- It's better to throw an exception when you encounter an error
write your try-catch-finally statement first
- exceptions define a scope within your program
- catch has to leave your program in a consistent state
- exceptions define a scope within your program
Use unchecked exceptions
- checked exceptions aren't necessary for the production of robust software
- the changed modules must be rebult and redeployed
- checked exceptions aren't necessary for the production of robust software
provide context with exceptions
- exceptions should provide context to determine the source and location of an error
- create informative error messages
- mention the operation that failed and the type of failure
- create informative error messages
- exceptions should provide context to determine the source and location of an error
define exception classes in terms of a caller's needs
- classify them by how they are caught
define the normal flow
- special case pattern
- create a class or configure an object so that it handless a special case
- the client code doesn't deal with the exception, the behavior is encapsulated in the special case object
- create a class or configure an object so that it handless a special case
- special case pattern
don't return null, but don't pass null
Information
- Description
- Mind Map on Error Handling, created by jocyroman on 09/11/2015.
- Created by
- jocyroman
- Views
- 0
- Rating