all-error-handler
АllЕrrorHandler provides you a object, which will listen for error events and then call a provided callback function.
UMD module.
АllЕrrorHandler package is exported as aInstallation
In a browser:
In Node.js:
let AllErrorHandler = ;
Usage
// Initialize object and pass a callback function to itlet errorHandler = { console;}; //Testthrow "Foo"; // Error occured - Error: Foo// at Object.<anonymous> ...
Params
Functioncallback BooleanstartListening = true
-- callback - pass a function which will be called after an Error is throwed.
-- startListening - if true it will start listining for the errors when the object is created.
Methods:
startListening();
-- Start listening for error events
errorHandler;
stopListening();
-- Stop listening for error events
errorHandler;
dispose();
-- Call before setting the object to null to prevent memory leak
errorHandler;errorHandler = null;
License
MIT