Enforce no-throw-literal rule in ESLint (#6418)

This commit is contained in:
Louis Lam
2025-11-26 16:10:06 +08:00
committed by GitHub
parent 5c83b17992
commit 892bd42dae
2 changed files with 2 additions and 1 deletions

View File

@@ -78,6 +78,7 @@ module.exports = {
"keyword-spacing": "warn",
"space-infix-ops": "error",
"arrow-spacing": "warn",
"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-constant-condition": [ "error", {
"checkLoops": false,

View File

@@ -51,7 +51,7 @@ class Webhook extends NotificationProvider {
...JSON.parse(notification.webhookAdditionalHeaders)
};
} catch (err) {
throw "Additional Headers is not a valid JSON";
throw new Error("Additional Headers is not a valid JSON");
}
}