Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

プロセスをしょうもないErrorで落とさないように頑張る

3,095 views

Published on

Node学園 22限目の発表資料です

Published in: Technology
  • Be the first to comment

プロセスをしょうもないErrorで落とさないように頑張る

  1. 1. • • •
  2. 2. • • • •
  3. 3. • • • •
  4. 4. • • • •
  5. 5. • • •
  6. 6. http.get('http://www.google.com/index.html', (res) => { console.log(`Got response: ${res.statusCode}`); // consume response body res.resume(); }).on('error', (e) => { console.log(`Got error: ${e.message}`); }); app.use(function(err, req, res, next) { console.error(err.stack); res.status(500).send('Something broke!'); }); function myFunc() { throw new Error(“Error”); } try { myFunc(); } catch(err) { // handle err }
  7. 7.
  8. 8.
  9. 9. • •
  10. 10. • • •
  11. 11. • • • •
  12. 12.
  13. 13. • • • •
  14. 14. • • • •
  15. 15. • • •
  16. 16. • • • •

×