node.jsエンジニア erlangに入門するの巻

Post on 09-Jan-2017

1.734 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

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}

• 

• 

• • • 

• 

• • 

• • • 

• 

• • 

• • 

  

• 

• • 

• • 

• 

• • 

• 

• • 

• 

• • 

• 

• • 

• 

• • 

• 

• 

• 

• • 

• 

• 

• • 

• • • 

• 

• • 

• 

• 

• 

top related