Skip to content
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

Delete encrypted storage in a try catch to avoid errors. #5942

Merged
merged 2 commits into from
May 20, 2021

Conversation

DavidKutu
Copy link

For #5934

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR).
  • Title summarizes what is changing.
  • Has a news entry file (remember to thank yourself!).
  • Appropriate comments and documentation strings in the code.
  • Has sufficient logging.
  • Has telemetry for enhancements.
  • Unit tests & system/integration tests are added/updated.
  • Test plan is updated as appropriate.
  • package-lock.json has been regenerated by running npm install (if dependencies have changed).

@DavidKutu DavidKutu requested a review from a team as a code owner May 20, 2021 21:11
await this.extensionContext.secrets.delete(`${service}.${key}`);
return;
try {
this.extensionContext.secrets.delete(`${service}.${key}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this won't be caught here. The promise is ignored.

You might try this instead:

this.extensionContext.secrets.delete(`${service}.${key}`).catch(traceError);

Copy link
Author

Choose a reason for hiding this comment

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

thenables don't have .catch

Copy link
Author

Choose a reason for hiding this comment

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

I'll put the await back

Copy link
Contributor

@rchiodo rchiodo left a comment

Choose a reason for hiding this comment

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

⏲️

@DavidKutu DavidKutu requested a review from rchiodo May 20, 2021 21:20
@DavidKutu DavidKutu merged commit b3f22c6 into main May 20, 2021
@DavidKutu DavidKutu deleted the david/fixStorageError branch May 20, 2021 22:14
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