I noticed recently that Exception
has several constructors which take Throwable
as a parameter. Throwable
has two subclasses, Error
and Exception
, and generally all documentation indicates that you should not attempt to catch or handle an Error
. Therefore, I am curious why Exception
takes a Throwable
as a constructor parameter instead of an Exception
. This implies that an Exception
could be created with an Error
as its cause and could be handled by the application. Why is this the case?
Should custom Exception
classes then only provide constructors that take Exception
as parameters?