Get Exception name : Exception « Development « JavaScript Tutorial






<html>
<head>
<title>Try Catch Example</title>
<script type="text/javascript">
try {
    window.nonExistentFunction();
} catch (oException) {
    alert("An exception occurred: " + oException.name);
} finally {
    alert("End of trycatch test.");
}
</script>
</head>
<body>
</body>
</html>








4.7.Exception
4.7.1.Syntactic exception
4.7.2.Array index to large exception
4.7.3.Get Exception message
4.7.4.Exception handler will bypass the statements
4.7.5.Get Exception name
4.7.6.Check the exception name and output exception message
4.7.7.Check Exception type with instanceof operator
4.7.8.Throw exception out of a function