mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-27 01:11:40 +00:00
refactor: enhance error handling with logging in various tools
- Added logging for exceptions in display.py, prompt_builder.py, browser_tool.py, code_execution_tool.py, terminal_tool.py to improve debugging and traceability. - Updated exception handling to log specific error messages instead of silently passing, providing better insights into failures during execution. - Ensured consistent use of logger.debug for non-critical errors across multiple files.
This commit is contained in:
parent
e4adb67ed8
commit
20b0e62f72
5 changed files with 50 additions and 47 deletions
|
|
@ -332,10 +332,10 @@ def _rpc_server_loop(
|
|||
pass
|
||||
finally:
|
||||
if conn:
|
||||
try:
|
||||
conn.close()
|
||||
except OSError:
|
||||
pass
|
||||
try:
|
||||
conn.close()
|
||||
except OSError as e:
|
||||
logger.debug("RPC conn close error: %s", e)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
@ -547,10 +547,10 @@ def execute_code(
|
|||
|
||||
finally:
|
||||
# Cleanup temp dir and socket
|
||||
try:
|
||||
server_sock.close()
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
server_sock.close()
|
||||
except Exception as e:
|
||||
logger.debug("Server socket close error: %s", e)
|
||||
try:
|
||||
import shutil
|
||||
shutil.rmtree(tmpdir, ignore_errors=True)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue