Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions libs/labelbox/src/labelbox/schema/foundry/foundry_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ def _get_app(self, id: str) -> App:
response = self.client.execute(query_str, params)
except exceptions.InvalidQueryError:
raise exceptions.ResourceNotFoundError(App, params)
except exceptions.LabelboxError as e:
# A missing app used to surface as InvalidQueryError; the API now
# returns a generic "not found" LabelboxError instead. Map it back
# to ResourceNotFoundError to preserve this method's contract.
if "not found" in str(e).lower():
raise exceptions.ResourceNotFoundError(App, params)
raise exceptions.LabelboxError(f"Unable to get app with id {id}", e)
except Exception as e:
raise exceptions.LabelboxError(f"Unable to get app with id {id}", e)
return App(**response["findModelFoundryApp"])
Expand Down
Loading