2017-12-07 7 views

答えて

0

あなたがキャッチされない例外を監視するプロセスのAPIを使用することができます。

process 
    .on('unhandledRejection', (reason, p) => { 
    // Use your own logger here 
    console.error(reason, 'Unhandled Rejection at Promise', p); 
    }) 
    .on('uncaughtException', err => { 
    // Use your own logger here 
    console.error(err, 'Uncaught Exception thrown'); 

    // Optional: Ensure process will stop after this 
    process.exit(1); 
    }); 

詳細な説明はこちらanswer to a similar questionここでスタックオーバーフローをチェックしてください。この素晴らしいブログ投稿もあります:https://shapeshed.com/uncaught-exceptions-in-node/

追加情報として、この他の情報を確認して、クラッシュ情報付きのメールを送信してください:https://coderwall.com/p/4yis4w/node-js-uncaught-exceptions

関連する問題