Edward Chen wrote:
We usually extend Exception instead of Throwable. Why? In what situations we extend Throwable.
Never extends throwable, extends Exception or an existing subclass of Exception as you want to add another kind of Exception not a kind of Throwable. You can extends RuntimeException if you need your exception to be unchecked.