I can’t seem to get finally
to work; I must be doing something wrong. I had:
->then( stuff => stuff -> Ok -> resolve )
->catch( error => switch and Error(reasons) -> resolve )
->then( result => switch on result and either Js.Exn.raiseError or resolveTheOk )
->finally( this never runs when an error occurs )
I guess the Js.Exn.raiseError
stops it from ever running, but… like… why… or rather, what should I be doing instead?
For context, I need to throw an Exception at the end because that’s how AWS Lambdas work. Their contract is “you return data or blow up”, so if I have an error, I need to have a normal exception at the end.