Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToOAuthError ¶
func ToOAuthError(err error) manifold.HTTPError
ToOAuthError receives an error and mutates it into an OAuthError based on the concrete type of the Error
Types ¶
type OAuthError ¶
type OAuthError struct { Type merrors.Type `json:"-"` ErrorType errors.OAuthErrorType `json:"error"` Description string `json:"error_description,omitempty"` }
OAuthError represents an error that follows the OAuth 2.0 specification. An OAuthError occurs during a component of an OAuth authentication flow.
These errors are only surfaced to a provider.
func NewOAuthError ¶
func NewOAuthError(t errors.OAuthErrorType, description string) *OAuthError
NewOAuthError returns an OAuthError which satisfies the Error, HTTPError and swag.Error interfaces.
description is optional and will be omitted from the response if its an empty string.
func (*OAuthError) Error ¶
func (e *OAuthError) Error() string
Error returns a string equivalent of this Error. It also completes the error interface.
func (*OAuthError) StatusCode ¶
func (e *OAuthError) StatusCode() int
StatusCode returns the http status code for this Error. It completes the HTTPError interface.
func (*OAuthError) WriteResponse ¶
func (e *OAuthError) WriteResponse(rw http.ResponseWriter, pr runtime.Producer)
WriteResponse completes the interface for a HTTPError; enabling an error to be returned as a middleware.Responder from go-openapi/runtime
A panic will occur if the given producer errors.