MCPcopy Create free account
hub / github.com/docker/docker-agent / writeError

Function writeError

pkg/chatserver/server.go:648–653  ·  view source on GitHub ↗

writeError writes an OpenAI-style error envelope.

(c echo.Context, status int, message string)

Source from the content-addressed store, hash-verified

646
647// writeError writes an OpenAI-style error envelope.
648func writeError(c echo.Context, status int, message string) error {
649 return c.JSON(status, ErrorResponse{Error: ErrorDetail{
650 Message: message,
651 Type: errTypeFor(status),
652 }})
653}
654
655func errTypeFor(status int) string {
656 if status >= 500 {

Callers 4

bearerAuthMiddlewareFunction · 0.70
handleChatCompletionsMethod · 0.70
chatCompletionMethod · 0.70

Calls 1

errTypeForFunction · 0.85

Tested by 1