Skip to content

Commit 4f57418

Browse files
authored
Fix the error trigger when model auto import (#743)
1 parent b559a74 commit 4f57418

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/app/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ def get_app_models():
2525
try:
2626
module_path = f'backend.app.{app}.model'
2727
module = import_module_cached(module_path)
28-
except Exception as e:
28+
except ModuleNotFoundError as e:
2929
log.warning(f'应用 {app} 中不包含 model 相关配置: {e}')
3030
continue
31+
except Exception as e:
32+
raise e
3133

3234
for name, obj in inspect.getmembers(module):
3335
if inspect.isclass(obj):

0 commit comments

Comments
 (0)