Add error message when interpretation fails#770
Merged
aeisenberg merged 2 commits intogithub:mainfrom Mar 2, 2021
Merged
Conversation
One way it can fail is if the SARIF is too large. We explicitly call out that error because the raw message received from the node runtime is not very understandable.
f5635c2 to
926856f
Compare
adityasharad
approved these changes
Mar 2, 2021
Contributor
adityasharad
left a comment
There was a problem hiding this comment.
Generally looks good. Minor suggestion on whether we can make the user-facing message shorter and more understandable, so they understand the exact impact.
| } catch (e) { | ||
| const rawMessage = e.stderr || e.message; | ||
| const errorMessage = rawMessage.startsWith('Cannot create a string') | ||
| ? `SARIF too large. ${rawMessage}` |
Contributor
There was a problem hiding this comment.
Could we log the raw message but make the user-facing one a bit friendlier? Something like "SARIF results are too large to process for the alerts view. Will show raw results instead."
Contributor
Author
There was a problem hiding this comment.
Hmmm...I think I can do that.
This was referenced Mar 15, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One way it can fail is if the SARIF is too large. We explicitly call
out that error because the raw message received from the node runtime
is not very understandable.
Fixes #759
Checklist
@github/docs-content-dsphas been cc'd in all issues for UI or other user-facing changes made by this pull request.