error

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unknown            = "Unknown"
	BadRequest         = "BadRequest"
	Unauthorized       = "Unauthorized"
	Forbidden          = "Forbidden"
	NotFound           = "NotFound"
	PreconditionFailed = "PreconditionFailed"
	Internal           = "Internal"
	ServiceUnavailable = "ServiceUnavailable"
	ModelServerError   = "ModelServerError"
	ResourceExhausted  = "ResourceExhausted"
)
View Source
const RequestDroppedReasonHeaderKey = "x-llm-d-request-dropped-reason"

RequestDroppedReasonHeaderKey is the HTTP response header that communicates the specific reason a request was dropped by flow control.

Variables

This section is empty.

Functions

func BuildErrResponse

func BuildErrResponse(err error) (*extProcPb.ProcessingResponse, error)

BuildErrResponse maps an error to an Envoy ImmediateResponse with the appropriate HTTP status code and error message body. If the error code is not recognized, it returns a gRPC error instead of an ImmediateResponse.

func CanonicalCode

func CanonicalCode(err error) string

CanonicalCode returns the error's ErrorCode.

Types

type Error

type Error struct {
	Code    string
	Msg     string
	Headers map[string]string
}

Error is an error struct for errors returned by the epp/bbr server.

func (Error) Error

func (e Error) Error() string

Error returns a string version of the error.

type RequestDroppedReason

type RequestDroppedReason string

RequestDroppedReason is the reason a request was rejected before dispatch or evicted after dispatch.

const (
	// Rejected — request never reached an inference server.
	RequestDroppedReasonSaturated        RequestDroppedReason = "rejected-saturated"
	RequestDroppedReasonTTLExpired       RequestDroppedReason = "rejected-ttl-expired"
	RequestDroppedReasonContextCancelled RequestDroppedReason = "rejected-context-cancelled"
	RequestDroppedReasonShuttingDown     RequestDroppedReason = "rejected-shutting-down"

	// Evicted — request was dispatched to an inference server and then killed.
	// The generic "evicted" reason is the current default used by ImmediateResponseEvictor.Evict().
	// The specific sub-reasons are forward-looking for when EvictN() callers specify why they're evicting.
	RequestDroppedReasonEvicted              RequestDroppedReason = "evicted"
	RequestDroppedReasonEvictedQueuePressure RequestDroppedReason = "evicted-queue-pressure"
	RequestDroppedReasonEvictedPriority      RequestDroppedReason = "evicted-priority"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL