-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Diagnose print parsing error on missing report (#454)
When the diagnose command is run and the installation report is missing the diagnose command crashes with an error. ``` UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'download_url' of undefined ``` This is because when the report can't be read the `getInstallationReport` function would only return an empty object, rather than the expected object with a parsing error. (Expected in the sense that's how our other integrations handle this type of error and that's what the diagnose tool on the server side expects.) With this change the report should no longer crash and the sent report includes the error about the missing installation report. I didn't know how to resolve a TypeScript issue with the optional `raw` key on the parsing error object, so I created a ParsingError type to indicate that it's a optional key. I couldn't get it to work otherwise. Part of #448
- Loading branch information
Showing
4 changed files
with
79 additions
and
46 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
packages/nodejs/.changesets/report-parse-errors-in-diagnose-report.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
bump: "patch" | ||
--- | ||
|
||
The diagnose report will report parsing errors on reading or parsing the installation report. Previously, a missing installation report file would crash the diagnose tool. |
This file contains 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
This file contains 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
Submodule diagnose
updated
4 files
+20 −13 | spec/diagnose_spec.rb | |
+2 −0 | spec/spec_helper.rb | |
+21 −3 | spec/support/runner.rb | |
+17 −0 | spec/support/runner_helper.rb |