kenkyee
03/25/2020, 11:00 AMlouiscad
03/25/2020, 11:59 AMIllegalStateException
doesn't fall into the "expected exceptions" to me.
If you don't declare a thrown exception, the app will crash. If the exception is likely to happen, you'll want to declare it, otherwise, if it's something normally impossible and it is okay to crash because it'd be an unrecoverable programmer error, then you can not declare it.Nikolay Kasyanov
04/02/2020, 6:47 AM@Throws
. Thoughts?louiscad
04/02/2020, 1:10 PMRuntimeException
and subclasses in @Throws
. Otherwise, you can catch it a rethrow it wrapped in a non RuntimeException
, or return an error type.