Created
May 10, 2012 17:34
-
-
Save ff6347/2654624 to your computer and use it in GitHub Desktop.
catch an error
This file contains hidden or 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
try{ | |
var no_no = nothing; // nothing does not exist | |
// so this produces an error | |
}catch(e){ | |
// open a window and show the alert. | |
// \n is just a breakline | |
// \" is to show quotation marks in text | |
alert("This is the error message \"e\":\n" + e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This Gist is part of MT4D coming soon on fabiantheblind.info