refactor: enhance error handling with structured logging across multiple modules

- Updated various modules including cli.py, run_agent.py, gateway, and tools to replace silent exception handling with structured logging.
- Improved error messages to provide more context, aiding in debugging and monitoring.
- Ensured consistent logging practices throughout the codebase, enhancing traceability and maintainability.
This commit is contained in:
teknium1 2026-02-21 03:32:11 -08:00
parent cbff1b818c
commit 748fd3db88
14 changed files with 134 additions and 110 deletions

View file

@ -39,9 +39,13 @@ env_path = PROJECT_ROOT / '.env'
if env_path.exists():
load_dotenv(dotenv_path=env_path)
import logging
from hermes_cli import __version__
from hermes_constants import OPENROUTER_BASE_URL
logger = logging.getLogger(__name__)
def cmd_chat(args):
"""Run interactive chat CLI."""
@ -512,8 +516,8 @@ def cmd_update(args):
print(f" + {len(result['copied'])} new skill(s): {', '.join(result['copied'])}")
else:
print(" ✓ Skills are up to date")
except Exception:
pass
except Exception as e:
logger.debug("Skills sync during update failed: %s", e)
# Check for config migrations
print()