error

package
v0.0.0-...-0ba3bd2 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2015 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Access_denied              = "access_denied"
	Account_selection_required = "account_selection_required"
	Consent_required           = "consent_required"
	Interaction_required       = "interaction_required"
	Invalid_client             = "invalid_client"
	Invalid_grant              = "invalid_grant"
	Invalid_request            = "invalid_request"
	Invalid_scope              = "invalid_scope"
	Login_required             = "login_required"
	Registration_not_supported = "registration_not_supported"
	Request_not_supported      = "request_not_supported"
	Request_uri_not_supported  = "request_uri_not_supported"
	Server_error               = "server_error"
	Unsupported_grant_type     = "unsupported_grant_type"
	Unsupported_response_type  = "unsupported_response_type"
	// OpenID Connect の仕様ではサンプルとしてしか登場しない。
	Invalid_token = "invalid_token"
)

error の値。

Variables

View Source
var Debug = false

デバッグログにリクエストボディを記録するかどうか。

Functions

func RedirectError

func RedirectError(w http.ResponseWriter, r *http.Request, origErr error, uri *url.URL, logPrefs ...interface{})

リダイレクトでエラーを返す。

func RespondHtml

func RespondHtml(w http.ResponseWriter, r *http.Request, origErr error, errTmpl *template.Template, logPrefs ...interface{})

HTML でエラーを返す。 テンプレートでは以下が使える。 {{.Status}}: HTTP ステータスコード。404 とか {{.StatusText}}: HTTP ステータスコード。Not Found とか {{.Error}}: エラーコード {{.Description}}: エラー内容 {{.Debug}}: エラー詳細

func RespondJson

func RespondJson(w http.ResponseWriter, r *http.Request, origErr error, logPrefs ...interface{})

JSON でエラーを返す。

func WrapApi

func WrapApi(stopper *server.Stopper, f server.HandlerFunc) http.HandlerFunc

func WrapPage

func WrapPage(stopper *server.Stopper, f server.HandlerFunc, errTmpl *template.Template) http.HandlerFunc

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

OAuth 2.0 や OpenID Connect 1.0 でのエラーレスポンスに必要な情報を含むエラー。

func From

func From(err error) *Error

通常のエラーから変換する。

func New

func New(errCod string, errDesc string, stat int, cause error) *Error

stat が 0 の場合、代わりに http.StatusInternalServerError が入る。

func (*Error) Cause

func (this *Error) Cause() error

func (*Error) Error

func (this *Error) Error() string

func (*Error) ErrorCode

func (this *Error) ErrorCode() string

func (*Error) ErrorDescription

func (this *Error) ErrorDescription() string

func (*Error) Status

func (this *Error) Status() int

Jump to

Keyboard shortcuts

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