📜  javascript 捕获特定错误 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:54.748000             🧑  作者: Mango

代码示例2
try {
  myRoutine();
} catch (e) {
  if (e instanceof RangeError) {
    // statements to handle this very common expected error
  } else {
    throw e;  // re-throw the error unchanged
  }
}