📜  自定义错误 js - Javascript 代码示例

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

代码示例2
class Testing extends Error {
  constructor(message) {
    super(message);
    this.name = this.constructor.name;
    this.message = message;
    Error.captureStackTrace(this, this.constructor);
  }
}