Sv443 2 mesiacov pred
rodič
commit
92ddc2e9ea
2 zmenil súbory, kde vykonal 17 pridanie a 11 odobranie
  1. 16 9
      src/utils/logging.ts
  2. 1 2
      tsconfig.json

+ 16 - 9
src/utils/logging.ts

@@ -103,18 +103,25 @@ ${t("generic_error_dialog_open_console_note", consPrefix, packageJson.bugs.url)}
   });
 }
 
-//#region rrror classes
+//#region error classes
+
+export class CustomError extends Error {
+  public readonly time: number;
+  constructor(name: string, message: string, opts?: ErrorOptions) {
+    super(message, opts);
+    this.name = name;
+    this.time = Date.now();
+  }
+}
 
-export class LyricsError extends Error {
-  constructor(message: string) {
-    super(message);
-    this.name = "LyricsError";
+export class LyricsError extends CustomError {
+  constructor(message: string, opts?: ErrorOptions) {
+    super("LyricsError", message, opts);
   }
 }
 
-export class PluginError extends Error {
-  constructor(message: string) {
-    super(message);
-    this.name = "PluginError";
+export class PluginError extends CustomError {
+  constructor(message: string, opts?: ErrorOptions) {
+    super("PluginError", message, opts);
   }
 }

+ 1 - 2
tsconfig.json

@@ -5,8 +5,7 @@
     "target": "ES2017",
     "outDir": "dist/out",
     "lib": [
-      "ES5",
-      "ES6",
+      "ES2022",
       "DOM",
       "DOM.Iterable"
     ],