Skip to content

move_look function error not handled #1476

@larrybirb

Description

@larrybirb

‎APIMethods._return‎ is not handling errors from ‎Looker40SDK.move_look function. We see a non-useful exception str() failed when the API fails which obscures debugging.

Traceback (most recent call last):
  File "/home/user/shared-tableau-scripts/gcp-perms/looker_api_move_look_production.py", line 23, in <module>
    response = sdk.move_look(id, folder)
  File "/home/user/.local/lib/python3.10/site-packages/looker_sdk/sdk/api40/methods.py", line 7417, in move_look
    self.patch(
  File "/home/user/.local/lib/python3.10/site-packages/looker_sdk/rtl/api_methods.py", line 210, in patch
    return self._return(response, structure)
  File "/home/user/.local/lib/python3.10/site-packages/looker_sdk/rtl/api_methods.py", line 102, in _return
    raise sdk_error
looker_sdk.error.SDKError: <exception str() failed>

The actual API error:

{"message":"Validation Failed","errors":[{"field":"folder_id","code":"already_exists","message":"folder_id and the folder id of the existing look must be different","documentation_url":"
https://cloud.google.com/looker/docs/r/err/4.0/422/patch/looks/:look_id/move"}],"documentation_url":"https://cloud.google.com/looker/docs/r/err/4.0/422/patch/looks/:look_id/move"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature requestp3Priority 3pythonPython SDK issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions