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

better error output in case the yaml could not be parsed #27

Open
lagebaue opened this issue Dec 8, 2020 · 0 comments
Open

better error output in case the yaml could not be parsed #27

lagebaue opened this issue Dec 8, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@lagebaue
Copy link

lagebaue commented Dec 8, 2020

For validate (or lint) actions:
Currently outputs no information to the user. Extension logs are empty. only in the developer view there is a warning and even that only contains the message, not the location/stack.

        vscode.window.showErrorMessage('Could not parse OpenAPI document as JSON or YAML!');
        console.warn(ex.message);

Maybe at least log the complete error?

            let error = new vscode.Diagnostic(range, ex.message, vscode.DiagnosticSeverity.Error);
            error.source = 'openapi-lint';
            diagnostics.push(error);

Interestingly enough for translate actions (in the code) it looks like it has better error logging. But when trying to execute them I get different errors:

mainThreadExtensionService.ts:65 [[object Object]]Cannot read property 'openapi' of undefined
$onExtensionRuntimeError @ host.ts:10
_doInvokeHandler @ rpcProtocol.ts:365
_invokeHandler @ rpcProtocol.ts:365
_receiveRequest @ rpcProtocol.ts:306
_receiveOneMessage @ rpcProtocol.ts:174
(anonymous) @ rpcProtocol.ts:105
fire @ event.ts:584
fire @ ipc.net.ts:431
_receiveMessage @ ipc.net.ts:764
(anonymous) @ ipc.net.ts:624
fire @ event.ts:584
acceptChunk @ ipc.net.ts:174
(anonymous) @ ipc.net.ts:174
t @ ipc.net.ts:900
emit @ events.js:223
addChunk @ _stream_readable.js:309
readableAddChunk @ _stream_readable.js:290
Readable.push @ _stream_readable.js:224
onStreamRead @ internal/stream_base_commons.js:181
mainThreadExtensionService.ts:66 TypeError: Cannot read property 'openapi' of undefined
	at path\.vscode\extensions\mermade.openapi-lint-1.2.0\extension.js:23:99
	at path\.vscode\extensions\mermade.openapi-lint-1.2.0\node_modules\call-me-maybe\index.js:13:28
	at processTicksAndRejections (internal/process/task_queues.js:76:11)
@MikeRalphson MikeRalphson added the enhancement New feature or request label Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants