Skip to content

Commit

Permalink
change catcher to be async function
Browse files Browse the repository at this point in the history
  • Loading branch information
honzabrecka committed Mar 20, 2019
1 parent 0761b50 commit 8093b11
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,5 @@ declare export var pipeP: <A, B>(...fns: Function[]) => UnaryFnP<A, B>

declare export var tryCatchP: <A, B>(
trier: (value: A) => Promise<B>,
catcher: (err: Error, value: A) => B,
catcher: (err: Error, value: A) => Promise<B>,
) => UnaryFnP<A, B>
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const tryCatchP = <A, B>(
try {
return await trier(value)
} catch (err) {
return catcher(err, value)
return await catcher(err, value)
}
}

Expand Down

0 comments on commit 8093b11

Please sign in to comment.