-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Return error response in submitBom #1108
Conversation
255067a
to
87d8f9b
Compare
@marob Can we also enhance server.js so that it returns the error message in line 160 https://github.com/marob/cdxgen/blob/87d8f9bf2c1036341d47775998931786ff9cf788/server.js#L160
|
OK. I'll do it next week. But I'm questioning myself: shouldn't we throw an error instead of returning it like I implemented in my PR? |
@marob may be use the |
OK @prabhu. I've rebased and applied the required modifications on |
@marob - awesome! Would you be able to update the recently added openapi spec - https://github.com/CycloneDX/cdxgen/blob/master/lib/server/openapi.yaml - to have the new response code and response structure. Happy to help if you'd like, just lmk |
@setchy I've added the requested modification in openapi. |
When an error occurs, there is no possibility for the calling code to know the details. In my case, I'd like to be able to log error response body, in particular to be able to know which validation is KO when uploading a SBOM to DependencyTrack (that recently enabled JsonSchema validation on upload). Signed-off-by: Maxime Robert <robert.maxime@gmail.com> Signed-off-by: Maxime Robert <maxime.robert@smile.fr>
When an error occurs, there is no possibility for the calling code to know the details.
In my case, I'd like to be able to log error response body, in particular to be able to know which validation is KO when uploading a SBOM to DependencyTrack (that recently enabled JsonSchema validation on upload).