File tree 1 file changed +4
-0
lines changed
packages/jupyter-ai/jupyter_ai/personas
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ def _init_persona_classes(self) -> None:
69
69
70
70
for persona_ep in persona_eps :
71
71
try :
72
+ # Load a persona class from each entry point
72
73
persona_class = persona_ep .load ()
73
74
assert issubclass (persona_class , BasePersona )
74
75
persona_classes .append (persona_class )
@@ -77,6 +78,9 @@ def _init_persona_classes(self) -> None:
77
78
f" - Loaded AI persona class '{ class_name } ' from '{ class_module } ' using entry point '{ persona_ep .name } '."
78
79
)
79
80
except Exception as e :
81
+ # On exception, log an error and continue.
82
+ # This does not stop the surrounding `for` loop. If a persona
83
+ # fails to load, it should not halt other personas from loading.
80
84
self .log .error (
81
85
f" - Unable to load AI persona from entry point `{ persona_ep .name } ` due to an exception printed below."
82
86
)
You can’t perform that action at this time.
0 commit comments