Skip to content
This repository was archived by the owner on Jul 20, 2026. It is now read-only.
This repository was archived by the owner on Jul 20, 2026. It is now read-only.

Manage 400 errors #294

Open
Open

Description

@jerome-jutteau

Hi,

Currently, if osc-cli get a 400, it will print a backtrace which is not quite a good user experience.

osc-cli api ReadVmsHealth --LoadBalancerName 'XXX'
Traceback (most recent call last):
File "/var/lib/XXX/.venv/bin/osc-cli", line 11, in <module>
sys.exit(main())
File "/var/lib/XXX/.venv/lib64/python3.6/site-packages/osc_sdk/sdk.py", line 785, in main
fire.Fire(api_connect)
File "/var/lib/XXX/.venv/lib64/python3.6/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/var/lib/XXX/.venv/lib64/python3.6/site-packages/fire/core.py", line 480, in _Fire
target=component.__name__)
File "/var/lib/XXX/.venv/lib64/python3.6/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "/var/lib/XXX/.venv/lib64/python3.6/site-packages/osc_sdk/sdk.py", line 766, in api_connect
handler.make_request(call, **kwargs)
File "/var/lib/XXX/.venv/lib64/python3.6/site-packages/osc_sdk/sdk.py", line 571, in make_request
verify=self.ssl_verify,
File "/var/lib/XXX/.venv/lib64/python3.6/site-packages/osc_sdk/sdk.py", line 502, in get_response
raise OscApiException(http_response)
osc_sdk.sdk.OscApiException: Error --> status = 400, code = 5063, code_type = InvalidResource, Reason = The VmId '{id}' doesn't exist., request_id = XXX

osc-cli should at least always catch exceptions and show a nice message when used as a cli (not a sdk)

Activity

  1. outscale-mgo commented on Feb 16, 2024

    @outscale-mgo

    Thanks for the issues, but this project is in maintenance mode, new CLI features should be done on oapi-cli
    If you really want that, you can still make a Pull Request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions