Skip to content

Commit 9f226cb

Browse files
committed
feat: allow custom logger on wrap
1 parent bbab5ac commit 9f226cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/2.pokemon.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { captureError } from './sentry.js';
22

3-
export default function wrap(callback, prefix = '') {
3+
export default function wrap(callback, prefix = '', logger = console) {
44
try {
55
return callback();
66
} catch (e) {
@@ -9,7 +9,7 @@ export default function wrap(callback, prefix = '') {
99
name,
1010
function: 'wrap',
1111
});
12-
console.error(`[${name}] Error occured`, e); // eslint-disable-line no-mixed-operators
12+
logger.error(`[${name}] Error occured`, e); // eslint-disable-line no-mixed-operators
1313
}
1414
return undefined;
1515
}

0 commit comments

Comments
 (0)