mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Raise dedicated EntityResolutionError
This commit is contained in:
parent
0067b417e7
commit
aec2ee828c
1 changed files with 5 additions and 1 deletions
|
|
@ -61,6 +61,10 @@ from ayon_core.pipeline.create import (
|
|||
_NOT_SET = object()
|
||||
|
||||
|
||||
class EntityResolutionError(Exception):
|
||||
"""Exception raised when entity URI resolution fails."""
|
||||
|
||||
|
||||
def resolve_entity_uri(entity_uri: str) -> str:
|
||||
"""Resolve AYON entity URI to a filesystem path for local system."""
|
||||
response = ayon_api.post(
|
||||
|
|
@ -76,7 +80,7 @@ def resolve_entity_uri(entity_uri: str) -> str:
|
|||
|
||||
entities = response.data[0]["entities"]
|
||||
if len(entities) != 1:
|
||||
raise RuntimeError(
|
||||
raise EntityResolutionError(
|
||||
f"Unable to resolve AYON entity URI '{entity_uri}' to a "
|
||||
f"single filepath. Received data: {response.data}"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue