Created
February 10, 2015 09:23
-
-
Save pierreinglebert/84f1825f8d93bdea92c4 to your computer and use it in GitHub Desktop.
try/catch async
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var fs = require('fs'); | |
fs.writeFileSync('testtry.txt', 'just a test file'); | |
try{ | |
fs.readFile('testtry.txt', function() { | |
throw new Error(); | |
}); | |
} catch(err) { | |
console.log('!!!!!!!!!!!!!!!!!! I CAUGHT IT !!!!!!!!!!!!!!!!!!!'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment