From ab0045a4e19b643fd16cebb0205d63b7cfae5d27 Mon Sep 17 00:00:00 2001 From: Shub Date: Fri, 9 Sep 2022 08:26:57 +0530 Subject: [PATCH] chore: throw entire error message on random failure --- docs/debug-extension.md | 34 ++++------------------------------ src/utils.ts | 2 +- 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/docs/debug-extension.md b/docs/debug-extension.md index 2620f43..01e9915 100644 --- a/docs/debug-extension.md +++ b/docs/debug-extension.md @@ -1,10 +1,5 @@ # Debug extension -Since `v1.4.1` this extension has started to log parser errors with line number details, so that -developers who are using this extension can help file better bugs with details on cause of the issue. -This will help maintainers of this extension to quickly resolve the issue, with provided reproduction -of the issue. - ## Test the extension in isolation - Disable all extensions @@ -35,31 +30,10 @@ Open your deveoper tools form VSCode `Help` menu: Find the error/warning in the VSCode devtools view. The error will have the following structure: -```ts -[Extension Host] { - "name": "CssSyntaxError", - "reason": string, - "file": "path to file that failed to parse", - "line": number, // Line number in the file where the parser failed - "column": number, // Column number in the line above where the parser failed - "endLine": number, - "endColumn": number -} +```yml +[cssvar]: ERROR MESSAGE ``` -> **Note:** CSSVar Extension v1.4.3 will add extension name for each of these logs printed -> by the extension, for it to be found easily. - -Check the line/column number in the file path mentioned in the above error, and provide -those details when raising a new issue. - -For e.g. check the following GIF, which demonstrates the error while parsing an SCSS file: - -![parser-error](https://user-images.githubusercontent.com/11786283/179459517-0b96c2ad-bb3a-4cfe-b653-20be78d0d27e.gif) - -In the above gif, the extension setup wasn't done properly for SASS/SCSS files, as mentioned -in [Custmize Extension](./customize-extension.md) doc. -Thus, the extension fails to parse [SASS Interpolation](https://sass-lang.com/documentation/interpolation). +> Add the filter `[cssvar]:` in the DevTools Console, for better visibility. -This can be fixed if developer sets [postcss-scss](https://github.com/postcss/postcss-scss) -syntax for the parser, as defined in [Adding Support for Custom Syntax](./customize-extension.md#adding-support-for-any-new-sytax). +Please share the entire error message when opening any issue. :bow: diff --git a/src/utils.ts b/src/utils.ts index 92faa7d..b32c44f 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -315,7 +315,7 @@ export const getCSSErrorMsg = ( 2 ); } - return JSON.stringify(error); + return error; }; export const getActiveRootPath = (firstFolderPath = CACHE.activeRootPath) => {