clean up log.error (#1109)
This commit is contained in:
parent
bd84329a08
commit
4fee123e72
2 changed files with 69 additions and 65 deletions
|
|
@ -75,11 +75,10 @@ def update_claude_config(
|
|||
if not config_file.exists():
|
||||
try:
|
||||
config_file.write_text("{}")
|
||||
except Exception as e:
|
||||
logger.error(
|
||||
except Exception:
|
||||
logger.exception(
|
||||
"Failed to create Claude config file",
|
||||
extra={
|
||||
"error": str(e),
|
||||
"config_file": str(config_file),
|
||||
},
|
||||
)
|
||||
|
|
@ -139,11 +138,10 @@ def update_claude_config(
|
|||
extra={"config_file": str(config_file)},
|
||||
)
|
||||
return True
|
||||
except Exception as e:
|
||||
logger.error(
|
||||
except Exception:
|
||||
logger.exception(
|
||||
"Failed to update Claude config",
|
||||
extra={
|
||||
"error": str(e),
|
||||
"config_file": str(config_file),
|
||||
},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -349,12 +349,11 @@ def run(
|
|||
|
||||
server.run(**kwargs)
|
||||
|
||||
except Exception as e:
|
||||
logger.error(
|
||||
f"Failed to run server: {e}",
|
||||
except Exception:
|
||||
logger.exception(
|
||||
"Failed to run server",
|
||||
extra={
|
||||
"file": str(file),
|
||||
"error": str(e),
|
||||
},
|
||||
)
|
||||
sys.exit(1)
|
||||
|
|
@ -464,8 +463,8 @@ def install(
|
|||
if dotenv:
|
||||
try:
|
||||
env_dict |= {k: v for k, v in dotenv.dotenv_values(env_file).items() if v is not None}
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to load .env file: {e}")
|
||||
except (OSError, ValueError):
|
||||
logger.exception("Failed to load .env file")
|
||||
sys.exit(1)
|
||||
else:
|
||||
logger.error("python-dotenv is not installed. Cannot load .env file.")
|
||||
|
|
|
|||
Loading…
Reference in a new issue