We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bbab5ac commit 9f226cbCopy full SHA for 9f226cb
src/utils/2.pokemon.js
@@ -1,6 +1,6 @@
1
import { captureError } from './sentry.js';
2
3
-export default function wrap(callback, prefix = '') {
+export default function wrap(callback, prefix = '', logger = console) {
4
try {
5
return callback();
6
} catch (e) {
@@ -9,7 +9,7 @@ export default function wrap(callback, prefix = '') {
9
name,
10
function: 'wrap',
11
});
12
- console.error(`[${name}] Error occured`, e); // eslint-disable-line no-mixed-operators
+ logger.error(`[${name}] Error occured`, e); // eslint-disable-line no-mixed-operators
13
}
14
return undefined;
15
0 commit comments