Commit Graph

1 Commits

Author SHA1 Message Date
Luca Furst c1a3cb5381
[App] Format client error ApiExceptions without a traceback (#15130)
## What does this PR do?

The lightning CLI uses the lightning APIs to create, read, update, and delete resources such as apps and clusters.

If an API call fails due to client error (e.g. invalid input, unauthorized, unauthenticated) the API will return an HTTP status code in the 400s, along with a custom message in the response body.

The CLI (usually) does not directly handle these exceptions. As a result the exception bubbles up through the click framework (which does not recognize the exception type) and to the python runtime, which produces a long traceback and dumps the raw exception to the user.

This PR fixes the user experience. When our API fails on a client error, the CLI will display the message from the server without a traceback.
2022-10-27 09:44:22 -04:00