Ali2206 commited on
Commit
70cbf2c
·
1 Parent(s): 0b71215

Add debug logging for router imports

Browse files
Files changed (1) hide show
  1. server.py +10 -2
server.py CHANGED
@@ -78,9 +78,17 @@ for mod_path, name in (
78
  ("AISaas.app.main", "saas_router"),
79
  ):
80
  try:
 
81
  module = __import__(mod_path, fromlist=["router"]) # type: ignore
82
- app.include_router(getattr(module, "router")) # type: ignore
83
- except Exception:
 
 
 
 
 
 
 
84
  pass
85
 
86
 
 
78
  ("AISaas.app.main", "saas_router"),
79
  ):
80
  try:
81
+ print(f"Importing {mod_path}...")
82
  module = __import__(mod_path, fromlist=["router"]) # type: ignore
83
+ router = getattr(module, "router")
84
+ print(f"Successfully imported {name}: {router}")
85
+ print(f"Router routes: {[route.path for route in router.routes]}")
86
+ app.include_router(router) # type: ignore
87
+ print(f"Successfully included {name}")
88
+ except Exception as e:
89
+ print(f"Failed to import {mod_path}: {e}")
90
+ import traceback
91
+ traceback.print_exc()
92
  pass
93
 
94