lib/util.js
function(handler, error, error_message) {
    if(typeof handler === 'function') {
        handler(error, error_message);
    } else {
        console.error(error_message || 'Unhandled exception raised: ', error);
    }
}
function(handler, error, error_message) {
    if(typeof handler === 'function') {
        handler(error, error_message);
    } else {
        console.error(error_message || 'Unhandled exception raised: ', error);
    }
}
function ( handler , error , error_message ) { if ( typeof handler === 'function' ) { handler ( error , error_message ) ; } else { console . error ( error_message || 'Unhandled exception raised: ' , error ) ; } }
If an error handler function is given, it is called with the error instance, otherwise log the error to the console
with a possible custom error message prefix. The custom message is passed also the error handler.

@param {function} handler - The error handler function.
@param {object | Error} error - The error instance.
@param {string} [error_message] - The custom error message, optional.
If an error handler function is given it is called with the error instance otherwise log the error to the console with a possible custom error message prefix . The custom message is passed also the error handler .