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

pull/6062/merge
Louis Lam 3 months ago committed by GitHub
parent 5c83b17992
commit 892bd42dae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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,

@ -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");
}
}

Loading…
Cancel
Save