Skip to content

Commit 3ffeac3

Browse files
committed
add setErrorCallback
@peteruithoven
1 parent f9f4e2c commit 3ffeac3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import ClipperLib from 'clipper-lib';
22

3-
ClipperLib.Error = function(message) {
4-
console.warn('clipper error', message);
3+
let errorCallback;
4+
export const setErrorCallback = (callback) => {
5+
errorCallback = callback;
6+
}
7+
ClipperLib.Error = (message) => {
8+
if (errorCallback) errorCallback(message);
59
}
610

711
const CLIPPER = new ClipperLib.Clipper();

0 commit comments

Comments
 (0)