Skip to content

Commit

Permalink
fix(debug): properly type debugCatch wrapper result (#1817)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieusieben authored Nov 30, 2023
1 parent 2513bd1 commit 691511b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/bsky/src/util/debug.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const debugCatch = <Func extends (...args: any[]) => any>(fn: Func) => {
return async (...args) => {
return async (...args: Parameters<Func>) => {
try {
return await fn(...args)
return (await fn(...args)) as Awaited<ReturnType<Func>>
} catch (err) {
console.error(err)
throw err
Expand Down
4 changes: 2 additions & 2 deletions packages/pds/src/util/debug.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const debugCatch = <Func extends (...args: any[]) => any>(fn: Func) => {
return async (...args) => {
return async (...args: Parameters<Func>) => {
try {
return await fn(...args)
return (await fn(...args)) as Awaited<ReturnType<Func>>
} catch (err) {
console.error(err)
throw err
Expand Down

0 comments on commit 691511b

Please sign in to comment.