Handling unknown exceptions (#23587)
* Handling unknown exceptions What to do when you do not know what kind of exceptions may be thrown by your application. * Added code formattingpull/24109/head^2
parent
3eb4f43c6d
commit
2a2598074e
|
@ -32,9 +32,10 @@ finally {
|
|||
// block of code to be executed after try block ends
|
||||
}
|
||||
```
|
||||
|
||||
## Advantage of Exception Handling
|
||||
The core advantage of exception handling is to maintain the normal flow of the application. An exception normally disrupts the normal flow of the application which is why we use exception handling.
|
||||
|
||||
Tip: If you are not really sure of what kind of exceptions your application may throw, use the `Exception` parent class to catch any anomaly and use the `stacktrace()` function on the `Exception` object to debug what went wrong.
|
||||
|
||||
#### More Information:
|
||||
- [Oracle Java Docs : Exception](https://docs.oracle.com/javase/specs/jls/se7/html/jls-11.html)
|
||||
|
|
Loading…
Reference in New Issue