ursus
11/30/2022, 12:16 AMtry catch
which doesn’t catch CancellationException
? or should I not care to rethrow that?Joffrey
11/30/2022, 12:53 AMCancellationException
if you have a catch
that is too wide. But you should try to limit your catch
in the first place. Try not to catch Exception
, focus on the expected exceptions.ursus
11/30/2022, 1:29 AMJoffrey
11/30/2022, 1:31 AMursus
11/30/2022, 1:32 AMursus
11/30/2022, 1:32 AMstreetsofboston
11/30/2022, 2:06 AMursus
11/30/2022, 2:21 AMnatario1
12/01/2022, 2:17 PMcatch (e: AllThrowablesExceptCancellation)
with catch Throwable + throw cancellation.
If I had a dollar for every if (e is CancellationException) throw e
that I wrote, I could fund the developmentJoffrey
12/01/2022, 11:38 PMIf I had a dollar for every if (e is CancellationException) throw e that I wrote, I could fund the developmentThen probably something is wrong with the design of your code. This kind of
catch(e: Exception)
should be rather rare, because it should only happen in the highest levels of the code. The lowest levels should just crash and focus on specific exceptionsursus
12/01/2022, 11:55 PMStylianos Gakis
12/07/2022, 9:57 PM