Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //abstract errors ErrAbstrForbidden = generateAbstrErr("request forbidden", "not authorized") ErrAbstrUnknown = generateAbstrErr("unknown", "unknown error") ErrAbstrInvalidArg = generateAbstrErr("invalid", "invalid argument") ErrAbstrInvalidEndpoint = generateAbstrErr("invalid", "invalid endpoint to parse") ErrAbstrInternal = generateAbstrErr("internal", "internal error") ErrAbstrAuthHeaderMissing = generateAbstrErr("authHeaderMissing", "Authorization header is missing") ErrAbstrAuthHeaderMalformed = generateAbstrErr("authHeaderMalformed", "Authorization header is malformed") ErrAbstrInvalidObligations = generateAbstrErr("internal", "invalid obligations") )
View Source
var ( ErrForbidden = NewHttpError(WithError(ErrAbstrForbidden), WithHttpStatus(http.StatusForbidden)) ErrUnknown = NewHttpError(WithError(ErrAbstrUnknown), WithHttpStatus(http.StatusInternalServerError)) ErrInvalidArg = NewHttpError(WithError(ErrAbstrInvalidArg), WithHttpStatus(http.StatusBadRequest)) )
Functions ¶
This section is empty.
Types ¶
type HttpError ¶
type HttpError struct { Status int // contains filtered or unexported fields }
func AbstractError ¶
AbstractError trims some privileged information from errors as these get sent directly as grpc responses
func GrpcToHttpError ¶
HttpError translates opa errors to http status errors
func NewHttpError ¶
Click to show internal directories.
Click to hide internal directories.