vllm_omni.errors ¶
Request-scoped client error types shared across vLLM-Omni entrypoints.
GuardrailViolationError ¶
OmniClientError ¶
Bases: ValueError
Request-scoped error that should be surfaced as a 4xx response. One example of using OmniClientError is GuardrailViolationError, which is captured and resurfaced as HTTP 400 error code, instead of a generic 500. OmniClientError should be used for any exceptions which need to be resurfaced as 4xx, as opposed to EngineDeadError/EngineGenerateError which are resurfaced as 500.
client_error_from_metadata ¶
client_error_from_metadata(
message: str,
*,
status_code: int | None,
error_type: str | None,
) -> OmniClientError
client_error_metadata ¶
client_error_metadata(
exc: BaseException,
) -> tuple[int | None, str | None]
raise_client_error_or ¶
raise_client_error_or(
message: str,
*,
status_code: int | None,
error_type: str | None,
fallback: Callable[[str], BaseException],
) -> NoReturn
Raise a client error for 4xx statuses, otherwise raise fallback(message).
Centralizes the "client-error-or-fallback" decision shared by the engine error paths so the status mapping lives in one place.