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

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

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