-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
Improve logging output from Nimma when a custom function errors #2053
Comments
I agree! |
We're also seeing reports of this error with the IBM openapi-validator which uses spectral as a dependency. |
@P0lip I work on a team in IBM (with @dpopp07) that supports the IBM openapi-validator that is now based on Spectral. Edit: After digging into the Nimma code a little bit I was able to see where the "Error running Nimma" errors are originating from. This led me to simply display more of the exception info that we receive in the AggregateError exceptions that are propagated from Spectral. |
🎉 This issue has been resolved in version @stoplight/spectral-cli-v6.3.0 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version @stoplight/spectral-core-v1.11.0 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version @stoplight/spectral-functions-v1.6.0 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
User story.
As a user of Spectral
When I write a custom function that is erroneous
I want to see more verbose logging than "Error running Nimma"
That helps me diagnose the problem with my code
Is your feature request related to a problem?
I've across to v6 of Spectral and gone about rewriting my custom functions in the revised style. In doing so I (naturally) wrote some poor code that was incorrect.
However, Spectral told me virtually nothing about my mistake other than telling me "Error running Nimma". After poking around in the Nimma package I found that the errors are correctly collected, but not echoed out to the console in any useful way. I added
console.error(__filename, this.errors)
in a couple of places and Bob's your uncle and Fanny is your mother's sister I had the logging I need.Describe the solution you'd like
I'm sure these logs are available to be echoed out so some means to see them when they happen would be very useful
Additional context
Given this clearly broken function:
And this here ruleset:
I get this result even with the
--verbose
flag on:The text was updated successfully, but these errors were encountered: