Weitere ähnliche Inhalte
Mehr von Recruit Technologies (20)
Node.jsエンジニア Erlangに入門するの巻
- 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(err) {
// handle err
}