Skip to content

Commit

Permalink
avoid loop at error
Browse files Browse the repository at this point in the history
  • Loading branch information
mickelindahl committed Dec 29, 2016
1 parent 500c591 commit d9847f1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ exports.register = function (server, options, next) {
// log error as fatal at creash
process.on('uncaughtException', function (err) {

console.log('ooops')
console.log('ooops');

if(_fatal){
return process.exit(1);
}

_fatal=true; //tricggers process.exit(1); when email have been sent
_server.app.log.fatal(err)

});

options.email.stream.on('sent', (msg)=>{
Expand Down

0 comments on commit d9847f1

Please sign in to comment.