From 2a2598074e843488bc36a7955a1a86480d47111d Mon Sep 17 00:00:00 2001 From: ShashwathJS <44303503+ShashwathJS@users.noreply.github.com> Date: Fri, 7 Dec 2018 14:14:49 +0530 Subject: [PATCH] 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 formatting --- guide/english/java/exception-handling/index.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guide/english/java/exception-handling/index.md b/guide/english/java/exception-handling/index.md index 374fc0e350..ac0029e18d 100644 --- a/guide/english/java/exception-handling/index.md +++ b/guide/english/java/exception-handling/index.md @@ -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)