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

Better error messages (python sdk) #1459

Open
blakew opened this issue Sep 30, 2024 · 1 comment
Open

Better error messages (python sdk) #1459

blakew opened this issue Sep 30, 2024 · 1 comment
Labels
lib/python Python client library

Comments

@blakew
Copy link

blakew commented Sep 30, 2024

Feature Request

Motivation

It's difficult to debug error messages using the python sdk

ex:

>>> endpoint_out = await svix.endpoint.create(appid,EndpointIn(**svix_endpoint_args,secret=secret))
Traceback (most recent call last):
  File "/usr/local/Cellar/[email protected]/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/__main__.py", line 58, in runcode
    return future.result()
  File "/usr/local/Cellar/[email protected]/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/_base.py", line 458, in result
    return self.__get_result()
  File "/usr/local/Cellar/[email protected]/3.10.11/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "<console>", line 1, in <module>
  File "/Users/blakewillmarth/faraday/fdy/workers/model_train/.venv/lib/python3.10/site-packages/svix/api.py", line 464, in create
    return await v1_endpoint_create.request_asyncio(
  File "/Users/blakewillmarth/faraday/fdy/workers/model_train/.venv/lib/python3.10/site-packages/svix/internal/openapi_client/api/endpoint/v1_endpoint_create.py", line 240, in request_asyncio
    await request_asyncio_detailed(
  File "/Users/blakewillmarth/faraday/fdy/workers/model_train/.venv/lib/python3.10/site-packages/svix/internal/openapi_client/api/endpoint/v1_endpoint_create.py", line 210, in request_asyncio_detailed
    return _build_response(client=client, response=response)
  File "/Users/blakewillmarth/faraday/fdy/workers/model_train/.venv/lib/python3.10/site-packages/svix/internal/openapi_client/api/endpoint/v1_endpoint_create.py", line 73, in _build_response
    parsed=_parse_response(client=client, response=response),
  File "/Users/blakewillmarth/faraday/fdy/workers/model_train/.venv/lib/python3.10/site-packages/svix/internal/openapi_client/api/endpoint/v1_endpoint_create.py", line 62, in _parse_response
    raise HTTPValidationError.init_exception(response.json(), response.status_code)
svix.internal.openapi_client.models.http_validation_error.HTTPValidationError

Proposal

It would be nice to get detail about the validation error in the error message.

Alternatives

@tasn tasn added the lib/python Python client library label Oct 4, 2024
@tasn
Copy link
Member

tasn commented Oct 4, 2024

I'm with you, thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib/python Python client library
Projects
None yet
Development

No branches or pull requests

2 participants