Skip to content

bgd client: make error messages more user-friendly

Santiago Gil requested to merge santigl/162-error-messages into master

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 and Uploader.

This merge request, when merged, will address issue/bug:

#162 (closed)

Edited by Santiago Gil

Merge request reports

Loading