8. 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(er
![Node.jsエンジニア Erlangに入門するの巻](https://cdn-ak-scissors.b.st-hatena.com/image/square/0d59f164371db93980c637adc50280f6d5a09de7/height=288;version=1;width=512/https%3A%2F%2Fcdn.slidesharecdn.com%2Fss_thumbnails%2F20160623dotsnodejs2-160708055929-thumbnail.jpg%3Fwidth%3D640%26height%3D640%26fit%3Dbounds)