Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled promise errors in output #117

Open
FreHu opened this issue Jul 15, 2021 · 4 comments
Open

Unhandled promise errors in output #117

FreHu opened this issue Jul 15, 2021 · 4 comments

Comments

@FreHu
Copy link
Contributor

FreHu commented Jul 15, 2021

I got a bunch of these when switching branches:

(node:4624) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 27)
We received a file change event
(node:4624) UnhandledPromiseRejectionWarning: SyntaxError: JSON5: invalid character '<' at 216:1
    at syntaxError (c:\Users\i348033\.vscode\extensions\larshp.vscode-abaplint-0.4.298\server\out\server.js:59677:17)
    at invalidChar (c:\Users\i348033\.vscode\extensions\larshp.vscode-abaplint-0.4.298\server\out\server.js:59622:12)
    at Object.value (c:\Users\i348033\.vscode\extensions\larshp.vscode-abaplint-0.4.298\server\out\server.js:58881:15)
    at lex (c:\Users\i348033\.vscode\extensions\larshp.vscode-abaplint-0.4.298\server\out\server.js:58672:42)
    at Module.parse (c:\Users\i348033\.vscode\extensions\larshp.vscode-abaplint-0.4.298\server\out\server.js:58619:17)
    at new Config (c:\Users\i348033\.vscode\extensions\larshp.vscode-abaplint-0.4.298\server\out\server.js:9937:29)
    at Setup.<anonymous> (c:\Users\i348033\.vscode\extensions\larshp.vscode-abaplint-0.4.298\server\out\server.js:61566:32)
    at Generator.next (<anonymous>)
    at fulfilled (c:\Users\i348033\.vscode\extensions\larshp.vscode-abaplint-0.4.298\server\out\server.js:61529:58)

suggest adding some generic catch blocks for unexpected situations as these errors always focus the output window

@FreHu
Copy link
Contributor Author

FreHu commented Jul 15, 2021

I think it's coming from here:

public async configChanged(documents: LServer.TextDocuments<TextDocument>) {
await this.readAndSetConfig();
for (const document of documents.all()) {
this.validateDocument(document);
}
}

@larshp
Copy link
Member

larshp commented Jul 15, 2021

in the branch switched to, does abaplint.json contain json syntax errors, or non existing?

@FreHu
Copy link
Contributor Author

FreHu commented Jul 15, 2021

no, both branches contain a valid file with different contents. i think something gets messed up when git is checking out the files. I don't think it happens every time

perhaps it is appending to the file and this triggers multiple change events, it would explain why there are multiple errors

maybe also worth noting that i'm using jsonc

@larshp
Copy link
Member

larshp commented Jul 15, 2021

"SyntaxError: JSON5: invalid character '<' at 216:1" it uses the JSON5 parser, so jsonc should be okay

but yea, should add some catch'es

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants