Skip to content

fix(AppResources): try recover if resources update fails #3492

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

Merged
merged 1 commit into from
Mar 30, 2018

Conversation

KristianDD
Copy link
Contributor

@KristianDD KristianDD commented Mar 23, 2018

Fixes #3510

@KristianDD
Copy link
Contributor Author

@rosen-vladimirov @Pip3r4o

this.recover(originalAppResources, appResourcesDestination, appResourcesBackup);
this.$logger.out("Failed to update resources. They should be in their initial state.");
} catch (error) {
this.$logger.out(`Failed to update resources.${EOL} Backup of original content is inside "${appResourcesBackup}".${EOL}If "${originalAppResources} if missing copy from backup folder."`);
Copy link
Contributor

Choose a reason for hiding this comment

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

If "${originalAppResources} iS missing...

Copy link
Contributor

Choose a reason for hiding this comment

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

Why don't we throw the original error here? Currently the command exits with code 0, as we've caught all errors, which is incorrect.

this.recover(originalAppResources, appResourcesDestination, appResourcesBackup);
this.$logger.out("Failed to update resources. They should be in their initial state.");
} catch (error) {
this.$logger.out(`Failed to update resources.${EOL} Backup of original content is inside "${appResourcesBackup}".${EOL}If "${originalAppResources} if missing copy from backup folder."`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also add this.$logger.trace with the currently caught error?

@KristianDD KristianDD force-pushed the kddimitrov/fix-resources-locked branch from f464c6c to 07469fb Compare March 29, 2018 12:09
Copy link
Contributor

@petekanev petekanev left a comment

Choose a reason for hiding this comment

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

lgtm

@KristianDD KristianDD force-pushed the kddimitrov/fix-resources-locked branch from 07469fb to 23b06df Compare March 30, 2018 10:56
Copy link
Contributor

@rosen-vladimirov rosen-vladimirov left a comment

Choose a reason for hiding this comment

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

Great work!

@KristianDD KristianDD force-pushed the kddimitrov/fix-resources-locked branch from 23b06df to dfa2df0 Compare March 30, 2018 11:42
@KristianDD KristianDD merged commit 159ca19 into release Mar 30, 2018
@KristianDD KristianDD deleted the kddimitrov/fix-resources-locked branch March 30, 2018 13:40
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