Skip to content

Conversation

@shetzel
Copy link
Contributor

@shetzel shetzel commented Nov 8, 2021

What does this PR do?

When a JsonParseError is thrown while reading stash.json for the deploy ID, the error is now caught, the file is renamed to stash.json_corrupted_ and an error message is displayed that shows the parse failure and the location of the renamed stash.json so users can inspect the file, or possibly rebuild a valid file from the corrupt version.

What issues does this PR fix or reference?

@W-7837761@

Testing:

  1. change stash.json to be invalid json
  2. delete stash.json
  3. change stash.json to be empty

In all cases an error should be thrown. In 1 & 3 the stash.json file will be renamed so running the command again will not result in the same behaviour.

Copy link
Contributor

@mshanemc mshanemc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a fine solution for a rare problem

@shetzel shetzel merged commit ac15a24 into main Nov 11, 2021
@shetzel shetzel deleted the sh/handle-corrupt-stash branch November 11, 2021 17:30
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

Successfully merging this pull request may close these issues.

3 participants