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

Catch JSON Exception When Attempting to Connect to Server #3898

Merged
merged 1 commit into from Apr 4, 2023

Conversation

viggyd
Copy link
Contributor

@viggyd viggyd commented Apr 3, 2023

Requirements for Contributing a Bug Fix or Enhancement

  • Fill out the template below. Any pull request that does not include enough information to be reviewed in timely manner will result in a request for you to update the pull request
    and possibly closure of the pull request if it is not provided after this request.
  • After you create the pull request, all status checks must pass before a maintainer will review your contribution.

Identify the Bug or Feature request

Fixes #3884

Description of the Change

When trying to connect to a server, the application will attempt to parse the return string as a JSON object. However, if the server doesn't exist, a null string is returned. When trying to convert this to JSON, there's an IllegalStateException and then the error pops up to the user.

After adding this body check, the application is able to resolve the error gracefully. It will pop up a short dialog saying "Server "x" is not found" or some such.

Possible Drawbacks

I cannot think of any. The added code does some minor error handling, it should not introduce any adverse effects.

Documentation Notes

N/A

Release Notes

  • Fixed an issue where connecting to a non-existent server caused an "unexpected error" to pop up

This change is Reviewable

When trying to connect to a server, the application will attempt to parse the
return string as a JSON object. However, if the server doesn't exist, a `null`
string is returned. When trying to convert this to JSON, there's an
`IllegalStateException` and then the error pops up to the user.

After adding this body check, the application is able to resolve the error
gracefully. It will pop up a short dialog saying "Server "x" is not found" or
some such.
@cwisniew cwisniew merged commit bfe5681 into RPTools:develop Apr 4, 2023
4 checks passed
@cwisniew cwisniew added bug feature Adding functionality that adds value and removed bug feature Adding functionality that adds value labels Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Unexpected Error Popup When Trying to Connect to Non-existent Server
2 participants