Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript catch specific error

try {
  myRoutine();
} catch (e) {
  if (e instanceof RangeError) {
    // statements to handle this very common expected error
  } else {
    throw e;  // re-throw the error unchanged
  }
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #javascript #catch #specific #error
ADD COMMENT
Topic
Name
2+6 =