Skip to content

Commit 5355596

Browse files
committed
Added debug logs on get_component_config
1 parent 2d6042b commit 5355596

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

src/superannotate/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import sys
44

55

6-
__version__ = "4.4.30b1"
6+
__version__ = "4.4.30b2"
77

88
os.environ.update({"sa_version": __version__})
99
sys.path.append(os.path.split(os.path.realpath(__file__))[0])

src/superannotate/lib/app/interface/sdk_interface.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -297,16 +297,20 @@ def get_component_config(self, project: Union[NotEmptyStr, int], component_id: s
297297
def retrieve_context(
298298
component_data: List[dict], component_pk: str
299299
) -> Tuple[bool, typing.Any]:
300-
for component in component_data:
301-
if (
302-
component["type"] == "webComponent"
303-
and component["id"] == component_pk
304-
):
305-
return True, component.get("context")
306-
if component["type"] in ("group", "grid") and "children" in component:
307-
found, val = retrieve_context(component["children"], component_pk)
308-
if found:
309-
return found, val
300+
try:
301+
for component in component_data:
302+
if (
303+
component["type"] == "webComponent"
304+
and component["id"] == component_pk
305+
):
306+
return True, component.get("context")
307+
if component["type"] in ("group", "grid") and "children" in component:
308+
found, val = retrieve_context(component["children"], component_pk)
309+
if found:
310+
return found, val
311+
except KeyError as e:
312+
logger.debug("Got key error:", component_data)
313+
raise e
310314
return False, None
311315

312316
project = (

0 commit comments

Comments
 (0)