Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manage 400 errors #294

Open
jerome-jutteau opened this issue Dec 14, 2023 · 1 comment
Open

Manage 400 errors #294

jerome-jutteau opened this issue Dec 14, 2023 · 1 comment

Comments

@jerome-jutteau
Copy link
Contributor

jerome-jutteau commented Dec 14, 2023

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)

@outscale-mgo
Copy link
Contributor

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
Labels
None yet
Development

No branches or pull requests

2 participants