File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
src/FsToolkit.ErrorHandling Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -44,20 +44,26 @@ module AsyncValidationCE =
4444 [<InlineIfLambda>] generator : unit -> AsyncValidation < 'ok , 'error >,
4545 [<InlineIfLambda>] handler : exn -> AsyncValidation < 'ok , 'error >
4646 ) : AsyncValidation < 'ok , 'error > =
47- try
48- this.Run generator
49- with e ->
50- handler e
47+ async {
48+ return !
49+ try
50+ this.Run generator
51+ with e ->
52+ handler e
53+ }
5154
5255 member inline this.TryFinally
5356 (
5457 [<InlineIfLambda>] generator : unit -> AsyncValidation < 'ok , 'error >,
5558 [<InlineIfLambda>] compensation : unit -> unit
5659 ) : AsyncValidation < 'ok , 'error > =
57- try
58- this.Run generator
59- finally
60- compensation ()
60+ async {
61+ return !
62+ try
63+ this.Run generator
64+ finally
65+ compensation ()
66+ }
6167
6268 member inline this.Using
6369 (
You can’t perform that action at this time.
0 commit comments