[Frontend] Clean Client Facing 500 Report (#58043)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,7 @@ def create_error_response(
|
||||
|
||||
if isinstance(message, Exception):
|
||||
exc = message
|
||||
message = str(exc)
|
||||
logger.debug(
|
||||
"create_error_response called with %s: %s", type(exc).__name__, exc
|
||||
)
|
||||
@@ -33,6 +34,7 @@ def create_error_response(
|
||||
VLLMUnprocessableEntityError,
|
||||
VLLMValidationError,
|
||||
)
|
||||
from vllm.v1.engine.exceptions import EngineDeadError
|
||||
|
||||
if isinstance(exc, GracefulHTTPError):
|
||||
err_type = HTTPStatus(exc.http_status).phrase
|
||||
@@ -63,6 +65,11 @@ def create_error_response(
|
||||
)
|
||||
status_code = exc.status_code
|
||||
param = None
|
||||
elif isinstance(exc, EngineDeadError):
|
||||
err_type = "InternalServerError"
|
||||
status_code = HTTPStatus.INTERNAL_SERVER_ERROR
|
||||
param = None
|
||||
message = exc.CLIENT_MESSAGE
|
||||
elif isinstance(exc, VLLMServerError):
|
||||
# Any other server-caused error defaults to 500.
|
||||
err_type = "InternalServerError"
|
||||
@@ -88,8 +95,6 @@ def create_error_response(
|
||||
status_code = HTTPStatus.INTERNAL_SERVER_ERROR
|
||||
param = None
|
||||
|
||||
message = str(exc)
|
||||
|
||||
return ErrorResponse(
|
||||
error=ErrorInfo(
|
||||
message=sanitize_message(message),
|
||||
|
||||
Reference in New Issue
Block a user