You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, in Java, it is generally consider a bad practice to catch Throwable instead of Exception due to Throwable being the super class of Error which represents lower level errors like OutOfMemory etc.
May I know is there any reason why runCatching is catching Throwable instead of Exception?
The text was updated successfully, but these errors were encountered:
Calls the specified function block and returns its encapsulated result if invocation was successful, catching any Throwable exception that was thrown from the block function execution and encapsulating it as a failure.
When this library was initially written I had an analogous method named Result.of which used Exception instead of Throwable, but then I deprecated it in favour of a top-level runCatching function to be consistent with how the stdlib operates.
Hi, in Java, it is generally consider a bad practice to catch Throwable instead of Exception due to Throwable being the super class of Error which represents lower level errors like OutOfMemory etc.
May I know is there any reason why runCatching is catching Throwable instead of Exception?
The text was updated successfully, but these errors were encountered: