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

Unusable error diagnostics output on broken config #208

Open
shoffmeister opened this issue Apr 11, 2023 · 1 comment
Open

Unusable error diagnostics output on broken config #208

shoffmeister opened this issue Apr 11, 2023 · 1 comment

Comments

@shoffmeister
Copy link

shoffmeister commented Apr 11, 2023

Describe the bug

Provided with an imperfect ruleset specification (.spectral.yaml), the vscode extension diagnostic output is unusable for actually diagnosing the problem.

To Reproduce

Drop a bad ruleset specification into a workspace which has any OpenAPI specs, e.g.

extends: spectral:oas

overrides:
  wombats:

Open the OpenAPI specs document to force revalidation.

Expected behavior

Reasonably helpful error output.

Actual behaviour

"Spectral: An error occurred while validating . Please see the 'Spectral' output channel for details."

Fair enough, but that output channel then has

[Error - 8:38:27 AM] An error occurred while validating document <document>:
Unable to read ruleset at ../.spectral.yaml. 
AggregateError

AggregateError is not helpful at all, as this ... aggregates the real errors. And the real errors are not shown anywhere.

npx spectral lint <document> --verbose will show a lot more detail - but then I am using the vscode extension for a reason ;)

Please, when there is an exception or an AggregateError emit the complete error context.

@shoffmeister
Copy link
Author

FWIW, this is only about the technical production of vscode error output - not the content of the error message emitted by the validator itself.

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

No branches or pull requests

1 participant