allow custom handler to intercept node errors