diff --git a/.eslintrc.js b/.eslintrc.js index 5da22e72d..ff3ec59c8 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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, diff --git a/server/notification-providers/webhook.js b/server/notification-providers/webhook.js index ab7d5f069..c547ef4a6 100644 --- a/server/notification-providers/webhook.js +++ b/server/notification-providers/webhook.js @@ -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"); } }