node.jsエンジニア erlangに入門するの巻
TRANSCRIPT
• • •
•
• • •
• •
• •
• • •
•
• •
• • •
•
• •
•
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}
•
•
• • •
•
• •
• • •
•
• •
• •
•
• •
• •
•
• •
•
• •
•
• •
•
• •
•
• •
•
•
•
• •
•
•
• •
• • •
•
• •
•
•
•