From b8ff78a1a631fe27d7a66a454805a116d96738d8 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 25 Jun 2023 18:09:42 +0900 Subject: feat(nuldoc): improve error classes See also: https://www.wantedly.com/companies/wantedly/post_articles/492456 --- nuldoc-src/errors.ts | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'nuldoc-src') diff --git a/nuldoc-src/errors.ts b/nuldoc-src/errors.ts index ab8052f..fa53583 100644 --- a/nuldoc-src/errors.ts +++ b/nuldoc-src/errors.ts @@ -1,3 +1,17 @@ -export class DocBookError extends Error {} -export class SlideError extends Error {} -export class XmlParseError extends Error {} +export class DocBookError extends Error { + static { + this.prototype.name = "DocBookError"; + } +} + +export class SlideError extends Error { + static { + this.prototype.name = "SlideError"; + } +} + +export class XmlParseError extends Error { + static { + this.prototype.name = "XmlParseError"; + } +} -- cgit v1.2.3-70-g09d2