Created
August 7, 2017 19:53
-
-
Save prof3ssorSt3v3/fd21ab75e9c6eff18818eb19594cef49 to your computer and use it in GitHub Desktop.
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
//throwing Errors and Exceptions | |
//and | |
//using Try...Catch to handle thrown Errors and Exceptions | |
//Error Types: | |
// EvalError, InternalError, RangeError, ReferenceError, | |
// SyntaxError, TypeError, URIError | |
try{ | |
//throw 'Javelin'; | |
//throw {name:'Bubba', message:'Salmon'}; | |
let url = "http://jsonplaceholder.typicode.com"; | |
fetch(url).then((response)=>{}) | |
//throw new Error('A stick'); | |
console.log('Hello'); | |
}catch(err){ | |
console.log('Caught', err.name, err.message); | |
}finally{ | |
console.log('Took you a long time'); | |
} | |
console.log('end'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment