Skip to content

Commit

Permalink
chore: debug function
Browse files Browse the repository at this point in the history
  • Loading branch information
cyperdark committed Jul 22, 2024
1 parent fb254de commit f67fa43
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/tosu/src/entities/AbstractEntity/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,13 @@ export abstract class AbstractEntity {
resetReportCount(id: string | number) {
this.errorsCount[id] = 0;
}

preventThrow(callback) {
try {
const result = callback();
return result;
} catch (error) {
return error as Error;
}
}
}

0 comments on commit f67fa43

Please sign in to comment.