Code using Handle.allow has to be very careful that none of the code it calls inside of it uses ApplicativeError or MonadError to modify thrown exceptions between when it is created using Raise and when Handle catches and unwraps the Submarine.
If this does happen to happen, the resulting error does not contain any information about the enclosed exception (it's toString is "cats.mtl.Handle$Submarine"), making debugging quite difficult.
Can Submarine be updated to include the wrapped error as it's cause or have some other change so that it'll show in the toString output?
Code using
Handle.allowhas to be very careful that none of the code it calls inside of it usesApplicativeErrororMonadErrorto modify thrown exceptions between when it is created usingRaiseand whenHandlecatches and unwraps theSubmarine.If this does happen to happen, the resulting error does not contain any information about the enclosed exception (it's
toStringis"cats.mtl.Handle$Submarine"), making debugging quite difficult.Can
Submarinebe updated to include the wrapped error as it's cause or have some other change so that it'll show in thetoStringoutput?