mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-14 16:18:03 +00:00
Better error message [ci skip]
This commit is contained in:
1 parent
d1f5856bac
commit
3a9cde185a
1 file changed
+7
-1
@@ -121,7 +121,13 @@ class SerenaAgentContext:
|
||||
try:
|
||||
return cls.from_name(str(name_or_path))
|
||||
except FileNotFoundError:
|
||||
return cls.from_yaml(name_or_path)
|
||||
try:
|
||||
return cls.from_yaml(name_or_path)
|
||||
except FileNotFoundError as e:
|
||||
raise FileNotFoundError(
|
||||
f"Context {name_or_path} not found in {CONTEXT_YAMLS_DIR}. You can load a custom context by using from_yaml() instead.\n"
|
||||
f"Available contexts:\n{cls.list_registered_context_names()}"
|
||||
) from e
|
||||
|
||||
@classmethod
|
||||
def list_registered_context_names(cls) -> list[str]:
|
||||
|
||||
Reference in new issue
Block a user