diff options
| author | nsfisis <nsfisis@gmail.com> | 2023-06-25 18:09:42 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2023-06-25 18:22:35 +0900 |
| commit | b8ff78a1a631fe27d7a66a454805a116d96738d8 (patch) | |
| tree | df4dbe0ab5a94b5d11397d0f878b0d12550e38e3 | |
| parent | 92c7b41ea10b0d43557e45bf24ed70dc1cdace18 (diff) | |
| download | blog.nsfisis.dev-b8ff78a1a631fe27d7a66a454805a116d96738d8.tar.gz blog.nsfisis.dev-b8ff78a1a631fe27d7a66a454805a116d96738d8.tar.zst blog.nsfisis.dev-b8ff78a1a631fe27d7a66a454805a116d96738d8.zip | |
feat(nuldoc): improve error classes
See also: https://www.wantedly.com/companies/wantedly/post_articles/492456
| -rw-r--r-- | nuldoc-src/errors.ts | 20 |
1 files changed, 17 insertions, 3 deletions
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"; + } +} |
