Skip to content

Need HTTP response code when error occurs #1589

Open
@jle-pass

Description

@jle-pass

Hi,

Using the download_dashboard_pdf.py script, I have this error:

Traceback (most recent call last):
  File "/looker/download_dashboard_pdf.py", line 107, in <module>
    main()
  File "/looker/download_dashboard_pdf.py", line 44, in main
    dashboard = cast(models.Dashboard, get_dashboard(dashboard_title))
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/looker/download_dashboard_pdf.py", line 51, in get_dashboard
    dashboard = next(iter(sdk.search_dashboards(title=title)), None)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/looker/lib/python3.11/site-packages/looker_sdk/sdk/api40/methods.py", line 4807, in search_dashboards
    self.get(
  File "/looker/lib/python3.11/site-packages/looker_sdk/rtl/api_methods.py", line 149, in get
    response = self.transport.request(
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "/looker/lib/python3.11/site-packages/looker_sdk/rtl/requests_transport.py", line 66, in request
    headers.update(authenticator(transport_options or {}))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/looker/lib/python3.11/site-packages/looker_sdk/rtl/auth_session.py", line 100, in authenticate
    token = self._get_token(transport_options)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/looker/lib/python3.11/site-packages/looker_sdk/rtl/auth_session.py", line 87, in _get_token
    self._login(transport_options)
  File "/looker/lib/python3.11/site-packages/looker_sdk/rtl/auth_session.py", line 148, in _login
    response = self._ok(
               ^^^^^^^^^
  File "/looker/lib/python3.11/site-packages/looker_sdk/rtl/auth_session.py", line 242, in _ok
    raise error.SDKError(response.value.decode(encoding="utf-8"))

looker_sdk.error.SDKError:
    message:           )]}'
{"errorStatus":{"code":9}}
    documentation_url:
    error_doc_url:
    error details:

The "errorStatus code 9" is not usefull for me for debug this error.

Could you print the HTTP response code (!= 2xx) when error occurs plesae ?
(for understand in which case the API error occurs).

I see a similar issue #1540, but on kotlin part.

Thank you, JL.

Metadata

Metadata

Assignees

Labels

p3Priority 3pythonPython SDK issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions