Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cause ¶
Cause returns a cause of Error if the cause exists. The function returns the original error if it is not an instance of Error.
Types ¶
type Error ¶
type Error struct { Kind Kind // contains filtered or unexported fields }
Error is an error's wrapper allows to add some context to an underlying error. and returns a pretty formatted error's message.
func New ¶
func New(args ...interface{}) *Error
New returns a new Error constructed from its arguments. The type of each argument determines its meaning. If more than one argument of a given type is presented, only the last one is recorded.
The types are:
errKind The class of error, such as IO error. errParam A business object's location with which the error happened. string Treated as an error message.
Arguments having another type is treated as the message's parameters. We recommend to place them at the end of argument's list to avoid confusing.
type Kind ¶
type Kind string
Kind describes an error kind.
const ( // KindOther is a kind for an untyped errors. // This kind is used by default when a error kind is not specified. KindOther Kind = "" // KindEndpointMissed is a kind of an error that happens when OpenID Connect endpoint is not specified. KindEndpointMissed Kind = "endpoint_is_missed" // KindEndpointInvalid is a kind of an error that happens when OpenID Connect endpoint is invalid. KindEndpointInvalid Kind = "endpoint_is_invalid" // KindClientIDMissed is a kind of an error that happens when OpenID Connect client ID is not specified. KindClientIDMissed Kind = "client_id_is_missed" // KindRedirectURIMissed is a kind of an error that happens when OpenID Connect client's redirect URI is not specified. KindRedirectURIMissed Kind = "redirect_uri_is_missed" // KindScopesMissed is a kind of an error that happens when OpenID Connect scopes are not specified. KindScopesMissed Kind = "scopes_are_missed" // KindIDTokenMissed is a kind of an error that happens when ID token is not specified. KindIDTokenMissed Kind = "id_token_is_missed" // KindUsernameMissed is a kind of an error that happens when a username is not specified. KindUsernameMissed Kind = "username_is_missed" // KindUsernameFieldMissed is a kind of an error that happens when a username field's selector is not specified. KindUsernameFieldMissed Kind = "username_field_selector_is_missed" // KindUsernameFieldInvalid is a kind of an error that happens when a username field's selector matches to an invalid form element. KindUsernameFieldInvalid Kind = "username_field_selector_is_invalid" // KindPasswordFieldMissed is a kind of an error that happens when a password field's selector is not specified. KindPasswordFieldMissed Kind = "password_field_selector_is_missed" // KindPasswordFieldInvalid is a kind of an error that happens when a password field's selector matches to an invalid form element. KindPasswordFieldInvalid Kind = "password_field_selector_is_invalid" // KindSubmitButtonMissed is a kind of an error that happens when a submit button's selector is not specified. KindSubmitButtonMissed Kind = "submit_button_selector_is_missed" // KindSubmitButtonInvalid is a kind of an error that happens when a submit button's selector matches to an invalid form element. KindSubmitButtonInvalid Kind = "submit_button_selector_is_invalid" // KindErrorMessageMissed is a kind of an error that happens when an error message's selector is not specified. KindErrorMessageMissed Kind = "error_message_selector_is_missed" // KindOIDCError is a kind of an error that is an OpenID Connect errors. KindOIDCError Kind = "openid_connect_error" // KindLoginError is a kind of an error that happens when authentication failed, for example, when username or password are invalid. KindLoginError Kind = "login_error" // KindTimeout is a kind of an error that happens when page loading exceeds a timeout. KindTimeout Kind = "timeout" )
Click to show internal directories.
Click to hide internal directories.