Help us shape the future of Go! Take the 2026 Go Developer Survey

serviceerr

package
v0.20.4 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRequest          = newErr("", CodeInvalidRequest)
	ErrUnauthorizedClient      = newErr("", CodeUnauthorizedClient)
	ErrAccessDenied            = newErr("", CodeAccessDenied)
	ErrUnsupportedResponseType = newErr("", CodeUnsupportedResponseType)
	ErrInvalidScope            = newErr("", CodeInvalidScope)
	ErrServerError             = newErr("", CodeServerError)
	ErrTemporarilyUnavailable  = newErr("", CodeTemporarilyUnavailable)
)

Defined by RFC6749 https://www.rfc-editor.org/rfc/rfc6749.html#section-4.1.2.1 https://www.rfc-editor.org/rfc/rfc6749.html#section-4.2.2.1

View Source
var (
	ErrInvalidClient        = newErr("", CodeInvalidClient)
	ErrInvalidGrant         = newErr("", CodeInvalidGrant)
	ErrUnsupportedGrantType = newErr("", CodeUnsupportedGrantType)
)

Defined by RFC6749 https://www.rfc-editor.org/rfc/rfc6749.html#section-5.2

View Source
var (
	ErrUnknown               = newErr("unknown error", CodeUnknown)
	ErrConflict              = newErr("already exists", CodeConflict)
	ErrNotFound              = newErr("not found", CodeNotFound)
	ErrStateExpired          = newErr("state expired", CodeStateExpired)
	ErrInvalidOIDCProvider   = newErr("invalid OIDC provider", CodeInvalidOIDCProvider)
	ErrInvalidCSRFToken      = newErr("invalid CSRF token", CodeInvalidCSRFToken)
	ErrUnauthorized          = newErr("unauthorized", CodeUnauthorizedClient)
	ErrInvalidAtHash         = newErr("invalid atHash token", CodeInvalidAtHashToken)
	ErrInvalidLoginCSRFToken = newErr("invalid login CSRF token", CodeInvalidLoginCSRFToken)
)

Custom defined

Functions

func RecordAndLogError

func RecordAndLogError(ctx context.Context, span trace.Span, err error, args ...any)

Types

type Code

type Code string
const (
	CodeInvalidRequest          Code = "invalid_request"
	CodeUnauthorizedClient      Code = "unauthorized_client"
	CodeAccessDenied            Code = "access_denied"
	CodeUnsupportedResponseType Code = "unsupported_response_type"
	CodeInvalidScope            Code = "invalid_scope"
	CodeServerError             Code = "server_error"
	CodeTemporarilyUnavailable  Code = "temporarily_unavailable"
)

Defined by RFC6749 https://www.rfc-editor.org/rfc/rfc6749.html#section-4.1.2.1 https://www.rfc-editor.org/rfc/rfc6749.html#section-4.2.2.1

const (
	CodeInvalidClient        Code = "invalid_client"
	CodeInvalidGrant         Code = "invalid_grant"
	CodeUnsupportedGrantType Code = "unsupported_grant_type"
)

Defined by RFC6749 https://www.rfc-editor.org/rfc/rfc6749.html#section-5.2

const (
	CodeUnknown                Code = "unknown"
	CodeConflict               Code = "conflict"
	CodeNotFound               Code = "not_found"
	CodeStateExpired           Code = "state_expired"
	CodeInvalidOIDCProvider    Code = "invalid_oidc_provider"
	CodeInvalidCSRFToken       Code = "invalid_csrf_token"
	CodeInvalidLoginCSRFToken  Code = "invalid_login_csrf_token"
	CodeInvalidAtHashToken     Code = "invalid_at_hash_token"
	CodeEndSessionNotSupported Code = "end_session_not_supported"
)

Custom defined

type Error

type Error struct {
	Err         Code   `json:"error"`
	Description string `json:"error_description,omitempty"` // Optional
}

func (*Error) Error

func (e *Error) Error() string

func (Error) HTTPStatus

func (e Error) HTTPStatus() int

Jump to

Keyboard shortcuts

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