What is the purpose of writing custom exception classes when mostly what it does is same. For eg, NullPointerException:
class NullPointerException extends Ru
The main purpose would be identify the custom / app-specific errors. You can also provide some additional methods there. For eg, we have custom exceptions that return custom messages, and also extracts cause and location from the stack trace.