mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
refactor: enhance error handling in user prompts
- Updated exception handling in multiple prompt functions to catch NotImplementedError alongside ImportError, improving robustness across the application. - Ensured fallback mechanisms are clearly documented for better understanding of platform limitations.
This commit is contained in:
parent
cd66546e24
commit
3c5bf5b9d8
4 changed files with 8 additions and 8 deletions
|
|
@ -116,7 +116,7 @@ def _prompt_choice(question: str, choices: list, default: int = 0) -> int:
|
|||
sys.exit(0)
|
||||
print()
|
||||
return idx
|
||||
except ImportError:
|
||||
except (ImportError, NotImplementedError):
|
||||
for i, c in enumerate(choices):
|
||||
marker = "●" if i == default else "○"
|
||||
style = Colors.GREEN if i == default else ""
|
||||
|
|
@ -179,7 +179,7 @@ def _prompt_toolset_checklist(platform_label: str, enabled: Set[str]) -> Set[str
|
|||
|
||||
return {CONFIGURABLE_TOOLSETS[i][0] for i in selected_indices}
|
||||
|
||||
except ImportError:
|
||||
except (ImportError, NotImplementedError):
|
||||
# Fallback: numbered toggle
|
||||
selected = set(pre_selected_indices)
|
||||
while True:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue