how can I get the exception name without getting the stack trace?
I am using exception.toString() to convert the thrown exception into a string, but I only want the exception name likeNullPointerException and not the entire stack trace.
How can I solve this?