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

Check if error data is present before using it #2293

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

vinistock
Copy link
Member

@vinistock vinistock commented Jul 11, 2024

Motivation

In #2285, I made a mistake an didn't check for error.data before using it. That catch statement may rescue more than just server error. For example, if we try to send a request when the connection has already been disposed, then we'll land on that catch, but the data attribute won't exist, which would then try to read it and throw another error.

Implementation

Made two changes:

  1. Started checking if data is there before accessing it
  2. Started disposing of the logger, which we weren't doing before (by pushing it to subscriptions)

@vinistock vinistock added bugfix This PR will fix an existing bug vscode This pull request should be included in the VS Code extension's release notes labels Jul 11, 2024
@vinistock vinistock self-assigned this Jul 11, 2024
@vinistock vinistock requested a review from a team as a code owner July 11, 2024 20:58
@vinistock vinistock requested review from andyw8 and st0012 July 11, 2024 20:58
@vinistock vinistock enabled auto-merge (squash) July 11, 2024 21:06
@vinistock vinistock merged commit 37ec812 into main Jul 11, 2024
35 checks passed
@vinistock vinistock deleted the vs/check_for_error_data branch July 11, 2024 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug vscode This pull request should be included in the VS Code extension's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants