bgd client: make error messages more user-friendly
Description
Currently, when executing a bgd command that fails to connect to a remote server, the output consists mainly of Python stack traces.
These changes make the errors shown to the users shorter and more descriptive.
Some sample outputs:
> bgd cas --remote http://wronghost:50052 upload-file /tmp/a.cpp
Queueing path=[/tmp/a.cpp]
Error: Uploading file: channel is in state TRANSIENT_FAILURE
> bgd cas --remote http://localhost:50051 upload-file /tmp/a.cpp # Port for RE instead of CAS server
Queueing path=[/tmp/a.cpp]
Error: Uploading file: Method not found!
> bgd cas --remote http://localhost:50052 download-file $digest $output # File that is not in the CAS
Error: Downloading file: Requested blob does not exist on the remote.
Changes proposed in this merge request:
- Catch exceptions for RPC operations in the client commands
- Slightly change some of the exceptions raised by the CAS
Downloader
andUploader
.
This merge request, when merged, will address issue/bug:
Edited by Santiago Gil