errors

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendHTML

func SendHTML(c *gin.Context, e *Error)

func SendJSON

func SendJSON(c *gin.Context, e *Error)

func SendRedirect

func SendRedirect(c *gin.Context, e *Error)

Types

type Error

type Error struct {
	Err          error    `json:"-"`
	RedirectURI  *url.URL `json:"-"`
	ResponseType string   `json:"-"`
	State        string   `json:"state,omitempty"`
	Reason       Reason   `json:"error"`
	Description  string   `json:"error_description,omitempty"`
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) StatusCode

func (e *Error) StatusCode() int

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Reason

type Reason string
var (
	// OpenID errors
	AccessDenied            Reason = "access_denied"
	InteractionRequired     Reason = "interaction_required"
	InvalidClient           Reason = "invalid_client"
	InvalidGrant            Reason = "invalid_grant"
	InvalidRequest          Reason = "invalid_request"
	InvalidRequestObject    Reason = "invalid_request_object"
	InvalidRequestURI       Reason = "invalid_request_uri"
	InvalidScope            Reason = "invalid_scope"
	InvalidToken            Reason = "invalid_token"
	LoginRequired           Reason = "login_required"
	ServerError             Reason = "server_error"
	TemporarilyUnavailable  Reason = "temporarily_unavailable"
	UnauthorizedClient      Reason = "unauthorized_client"
	UnsupportedGrantType    Reason = "unsupported_grant_type"
	UnsupportedResponseType Reason = "unsupported_response_type"

	// original errors
	MethodNotAllowed Reason = "method_not_allowed"
	PageNotFound     Reason = "page_not_found"
)

func (Reason) String

func (e Reason) String() string

Jump to

Keyboard shortcuts

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