Reputation: 1270
I know that using following block, it is able to catch an Exception
.
try{
// Code
}catch(err){
alert(err.message);
}
Say, I want to catch a NumberFormatException
. How can I catch a specific Exception
using JavaScript
?
(I actually want to catch NumberFormatException
, InterruptedException
, ConnectException
which are well defined in Java
)
Upvotes: 6
Views: 4630