errdefs

package
v0.0.0-...-e4e1157 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInternal                           = Status("internal_server_error", 500)
	ErrDatabase                           = Status("database_error", 500)
	ErrPermissionDenied                   = Status("permission_denied", 403)
	ErrInvalidArgument                    = Status("invalid_argument", 400)
	ErrAlreadyExists                      = Status("already_exists", 409)
	ErrUnauthenticated                    = Status("unauthenticated", 401)
	ErrAPIKeyNotFound                     = Status("api_key_not_found", 404)
	ErrEnvironmentNotFound                = Status("environment_not_found", 404)
	ErrEnvironmentSlugAlreadyExists       = Status("environment_slug_already_exists", 409)
	ErrEnvironmentDeletionNotAllowed      = Status("environment_deletion_not_allowed", 409)
	ErrGroupNotFound                      = Status("group_not_found", 404)
	ErrGroupSlugAlreadyExists             = Status("group_slug_already_exists", 409)
	ErrHostInstanceNotFound               = Status("host_instance_not_found", 404)
	ErrHostInstanceStatusNotOnline        = Status("host_instance_status_not_online", 404)
	ErrHostConnectionNotFound             = Status("host_connection_not_found", 404)
	ErrHostConnectionClosed               = Status("host_connection_closed", 502)
	ErrOrganizationNotFound               = Status("organization_not_found", 404)
	ErrOrganizationSubdomainAlreadyExists = Status("organization_subdomain_already_exists", 409)
	ErrPageNotFound                       = Status("page_not_found", 404)
	ErrSessionNotFound                    = Status("session_not_found", 404)
	ErrUserNotFound                       = Status("user_not_found", 404)
	ErrUserEmailAlreadyExists             = Status("user_email_already_exists", 409)
	ErrUserRegistrationRequestNotFound    = Status("user_registration_request_not_found", 404)
	ErrUserInvitationNotFound             = Status("user_invitation_not_found", 404)
	ErrUserGoogleAuthRequestNotFound      = Status("user_google_auth_request_not_found", 404)
	ErrUserOrganizationAccessNotFound     = Status("user_organization_access_not_found", 404)
	ErrUserGroupNotFound                  = Status("user_group_not_found", 404)
	ErrUserMultipleOrganizations          = Status("user_multiple_organizations", 422)
	ErrEnvironmentLimitReached            = Status("environment_limit_reached", 403)
	ErrUserLimitReached                   = Status("user_limit_reached", 403)
)

Functions

func IsEnvironmentLimitReached

func IsEnvironmentLimitReached(err error) bool

func IsEnvironmentNotFound

func IsEnvironmentNotFound(err error) bool

func IsGroupNotFound

func IsGroupNotFound(err error) bool

func IsHostInstanceNotFound

func IsHostInstanceNotFound(err error) bool

func IsOrganizationNotFound

func IsOrganizationNotFound(err error) bool

func IsPageNotFound

func IsPageNotFound(err error) bool

func IsSessionNotFound

func IsSessionNotFound(err error) bool

func IsUserGoogleAuthRequestNotFound

func IsUserGoogleAuthRequestNotFound(err error) bool

func IsUserInvitationNotFound

func IsUserInvitationNotFound(err error) bool

func IsUserLimitReached

func IsUserLimitReached(err error) bool

func IsUserNotFound

func IsUserNotFound(err error) bool

func IsUserOrganizationAccessNotFound

func IsUserOrganizationAccessNotFound(err error) bool

func IsUserRegistrationRequestNotFound

func IsUserRegistrationRequestNotFound(err error) bool

Types

type Error

type Error struct {
	ID     string         `json:"id"`
	Status int            `json:"status"`
	Title  string         `json:"title"`
	Detail string         `json:"detail"`
	Meta   map[string]any `json:"meta"`
	Frames stackTrace     `json:"-"`
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) StackTrace

func (e *Error) StackTrace() []string

type Meta

type Meta []any

type StatusFunc

type StatusFunc func(error, ...any) error

func Status

func Status(title string, status int) StatusFunc

Jump to

Keyboard shortcuts

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