Created
November 5, 2010 11:35
-
-
Save dtsn/664013 to your computer and use it in GitHub Desktop.
Custom Exceptions in JavaScript
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
function myExceptionHandler() {} | |
try { | |
throw new myExceptionHandler; | |
} catch (e) { | |
if (e instanceOf myExceptionHandler) { | |
// handle it | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment