Skip to content

Commit 0785eb3

Browse files
committed
fix: update error handling in manage.py 💡
This commit refines the error handling in the `manage.py` script. Specifically, it captures and logs the exception message when an `ImportError` occurs during application import. This provides more detailed logging and helps in diagnosing issues related to application loading. Additionally, it updates the `ruff` configuration to include a new check for try/except blocks (`TRY400`).
1 parent 2d1fbc9 commit 0785eb3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

muffin/manage.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ def cli():
294294
app = import_app(args_.app)
295295
app.logger.info("Application is loaded: %s", app.cfg.name)
296296

297-
except (ImportError, ModuleNotFoundError):
298-
logging.exception("Failed to import application")
297+
except ImportError as exc:
298+
logging.error("Failed to import application: %s", exc)
299299
return sys.exit(1)
300300

301301
try:
@@ -307,4 +307,4 @@ def cli():
307307
sys.exit(0)
308308

309309

310-
# ruff: noqa: T100, LOG015
310+
# ruff: noqa: T100, LOG015, TRY400

0 commit comments

Comments
 (0)