[gRPC] Preserve original ImportError in grpc_server.py (#21801)
Signed-off-by: Chang Su <chang.s.su@oracle.com>
This commit is contained in:
@@ -7,9 +7,11 @@ async def serve_grpc(server_args, model_info=None):
|
||||
"""Start the standalone gRPC server with integrated scheduler."""
|
||||
try:
|
||||
from smg_grpc_servicer.sglang.server import serve_grpc as _serve_grpc
|
||||
except ImportError:
|
||||
except ImportError as e:
|
||||
raise ImportError(
|
||||
"gRPC mode requires the smg-grpc-servicer package. "
|
||||
"Install it with: pip install smg-grpc-servicer[sglang]"
|
||||
) from None
|
||||
"If not installed, run: pip install smg-grpc-servicer[sglang]. "
|
||||
"If already installed, there may be a broken import due to a "
|
||||
"version mismatch — see the chained exception above for details."
|
||||
) from e
|
||||
await _serve_grpc(server_args, model_info)
|
||||
|
||||
Reference in New Issue
Block a user