Skip to content

Commit eeedd83

Browse files
authored
Merge pull request #1613 from papr/start_plugin_error_handling
Improve start_plugin error handling
2 parents 99a0701 + e38ce03 commit eeedd83

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pupil_src/launchables/world.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,12 @@ def handle_notifications(noti):
393393
g_pool.plugins.add(g_pool.plugin_by_name["Dummy_Gaze_Mapper"])
394394
g_pool.detection_mapping_mode = noti["mode"]
395395
elif subject == "start_plugin":
396-
g_pool.plugins.add(
397-
g_pool.plugin_by_name[noti["name"]], args=noti.get("args", {})
398-
)
396+
try:
397+
g_pool.plugins.add(
398+
g_pool.plugin_by_name[noti["name"]], args=noti.get("args", {})
399+
)
400+
except KeyError as err:
401+
logger.error(f"Attempt to load unknown plugin: {err}")
399402
elif subject == "stop_plugin":
400403
for p in g_pool.plugins:
401404
if p.class_name == noti["name"]:

0 commit comments

Comments
 (0)