deislabs / bindle

Bindle: Object Storage for Collections
Apache License 2.0
263 stars 37 forks source link

improve error messages for network connection failures #232

Closed technosophos closed 3 years ago

technosophos commented 3 years ago

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:

$ bindle --server http://bindle.f1sh.ca:8080/v1 search
Server has encountered an error: The request could not be handled by the server. Verify your Bindle server URL

A networking error occurred during connection (e.g. wrong port, server disconnects abruptly):

$ bindle --server http://bindle.f1sh.ca/v1 search
Server has encountered an error: Protocol error. Verify the Bindle URL

Closes #231

Signed-off-by: Matt Butcher matt.butcher@microsoft.com

thomastaylor312 commented 3 years ago

@technosophos Did you need any more feedback here or can we merge?

technosophos commented 3 years ago

Merge away. I forgot about this PR