From 2d1c368c221b96c1d5715689f724f955768f6c2e Mon Sep 17 00:00:00 2001 From: abose Date: Fri, 13 Sep 2024 15:58:19 +0530 Subject: [PATCH] fix: bugsnag errors like Unknown exec function received htmlLint --- src/extensions/default/CSSCodeHints/css-lint.js | 3 +++ src/extensions/default/HTMLCodeHints/html-lint.js | 3 +++ src/extensions/default/JSLint/JSHint.js | 5 ++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/extensions/default/CSSCodeHints/css-lint.js b/src/extensions/default/CSSCodeHints/css-lint.js index 7fe03a5a8..3fcfef070 100644 --- a/src/extensions/default/CSSCodeHints/css-lint.js +++ b/src/extensions/default/CSSCodeHints/css-lint.js @@ -79,6 +79,9 @@ define(function (require, exports, module) { resolve({ errors: lintResult }); } resolve(); + }).catch(err=>{ + console.error("CSS Lint failed:", err); + reject(new Error("CSS Lint failed as CSS Lint plugin is not yet loaded. Please try again.")); }); }); } diff --git a/src/extensions/default/HTMLCodeHints/html-lint.js b/src/extensions/default/HTMLCodeHints/html-lint.js index 3cf5e2bd2..aa10ec1d8 100644 --- a/src/extensions/default/HTMLCodeHints/html-lint.js +++ b/src/extensions/default/HTMLCodeHints/html-lint.js @@ -112,6 +112,9 @@ define(function (require, exports, module) { resolve({ errors: lintResult }); } resolve(); + }).catch(err=>{ + console.error("HTML Lint failed:", err); + reject(new Error("HTML Lint failed as HTML plugin is not yet loaded. Please try again.")); }); }); } diff --git a/src/extensions/default/JSLint/JSHint.js b/src/extensions/default/JSLint/JSHint.js index 825538c72..83e569ce4 100644 --- a/src/extensions/default/JSLint/JSHint.js +++ b/src/extensions/default/JSLint/JSHint.js @@ -87,7 +87,7 @@ define(function (require, exports, module) { * a gold star when no errors are found. */ async function lintOneFile(text, _fullPath) { - return new Promise((resolve)=>{ + return new Promise((resolve, reject)=>{ if(jsHintConfigFileErrorMessage){ resolve({ errors: _getLinterConfigFileErrorMsg() }); return; @@ -118,6 +118,9 @@ define(function (require, exports, module) { resolve({ errors: errors }); } resolve(); + }).catch(err=>{ + console.error("JSHint failed:", err); + reject(new Error("JSHint failed as JSHint plugin is not yet loaded. Please try again.")); }); }); }