Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Code ¶
type Code int
Code represents type of internal error
const ( // UpstreamConnFailure represents failure to connect to the upstream gRPC service UpstreamConnFailure Code = 1 // ServiceUnresolvable represents failure to resolve a gRPC service to its upstream FQDN ServiceUnresolvable Code = 2 // ServiceNotFound represents a missing gRPC service in an upstream, even though the service resolved to that upstream ServiceNotFound Code = 3 // MethodNotFound represents a missing gRPC method in an upstream MethodNotFound Code = 4 // MessageTypeMismatch represents user provided JSON not matching the message's type MessageTypeMismatch Code = 5 // Unknown represents an unknown internal error Unknown Code = 6 // VersionNotSpecified represents the user not specifying the upstream version when it is required. VersionNotSpecified Code = 7 // VersionUndecidable represents there being multiple upstreams that match the specified (service, version) pair VersionUndecidable Code = 8 )
type GRPCError ¶
type GRPCError struct { StatusCode int `json:"code"` Message string `json:"message"` Details []*any.Any `json:"details,omitempty"` }
GRPCError is an error returned by gRPC upstream
func (*GRPCError) HTTPStatusCode ¶
HTTPStatusCode converts gRPC status codes to HTTP status codes https://github.com/grpc-ecosystem/grpc-gateway/blob/7951e5b80744558ae3363fd792806e1db15e91a4/runtime/errors.go
type ProxyError ¶
ProxyError represents internal errors
func (*ProxyError) HTTPStatusCode ¶
func (e *ProxyError) HTTPStatusCode() int
HTTPStatusCode returns the HTTP status code for a internal error
Click to show internal directories.
Click to hide internal directories.