This repository was archived by the owner on Feb 11, 2025. It is now read-only.
improve error messages for network connection failures#232
Merged
technosophos merged 2 commits intodeislabs:mainfrom Sep 29, 2021
Merged
improve error messages for network connection failures#232technosophos merged 2 commits intodeislabs:mainfrom
technosophos merged 2 commits intodeislabs:mainfrom
Conversation
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
itowlson
reviewed
Sep 13, 2021
src/client/error.rs
Outdated
| }, | ||
| /// A server error was encountered. Contains an optional message from the server | ||
| #[error("Server has encountered an error: {0:?}")] | ||
| #[error("Server has encountered an error: {}", .0.clone().unwrap_or_else(||"Protocol error. Verify the Bindle URL".to_owned()))] |
Contributor
There was a problem hiding this comment.
From what you said this could result from the wrong port or from a network disconnect? If so I feel like "Server has encountered an error" may send people down the wrong path here... but also very hard to get clear wording for what could be a wide range of cases that are hard to tell apart!
Contributor
Author
There was a problem hiding this comment.
Maybe "Networking error: {}" would be more accurate
Contributor
Author
There was a problem hiding this comment.
Ah! "Error contacting server"
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
thomastaylor312
approved these changes
Sep 16, 2021
Contributor
|
@technosophos Did you need any more feedback here or can we merge? |
Contributor
Author
|
Merge away. I forgot about this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This traps networking errors and makes a noble effort to be informative.
Most, if not all, network errors will be due to either network failure or pointing at the wrong URL. This PR tries to catch those that result in hitting the wrong URL.
Server responds 400 BAD REQUEST:
A networking error occurred during connection (e.g. wrong port, server disconnects abruptly):
Closes #231
Signed-off-by: Matt Butcher matt.butcher@microsoft.com