apperr

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2025 License: MIT Imports: 2 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DetailedError

type DetailedError interface {
	Details() ErrorDetails
}

type ErrorDetails

type ErrorDetails struct {
	Reason  string
	Details map[string]string
}

type ErrorType

type ErrorType string
const (
	ErrorTypeNotImplemented   ErrorType = "not_implemented"
	ErrorTypeInvalidArgument  ErrorType = "invalid_argument"
	ErrorTypeInternal         ErrorType = "internal_issue"
	ErrorTypeUnauthorized     ErrorType = "unauthorized"
	ErrorTypeConflict         ErrorType = "conflict"
	ErrorTypeUnavailable      ErrorType = "service_unavailable"
	ErrorTypeResourceNotFound ErrorType = "resource_not_found"
)

func GetErrorTypeOrNil

func GetErrorTypeOrNil(err error) *ErrorType

type FixableError

type FixableError interface {
	TroubleshootingTip() string
}

type InternalError

type InternalError struct{}

InternalError

This error should be raised if an unrecoverable error has happened that cannot be covered by another error.
Usually it means something unexpected broke
This is akin to an HTTP 500, GRPC Internal (13)

func (InternalError) Error

func (e InternalError) Error() string

func (InternalError) Type

func (InternalError) Type() ErrorType

type InvalidArgumentError

type InvalidArgumentError struct{}

InvalidArgumentError

This error is raised if one or multiple argument to a function has invalid or not-present mandatory parameters.
Usually it means you have not properly called the function
This is akin to an HTTP 400, GRPC InvalidArgument (3)

func (InvalidArgumentError) Error

func (e InvalidArgumentError) Error() string

func (InvalidArgumentError) Type

type NotImplementedError

type NotImplementedError struct{}

NotImplementedError

This error is raised if the code hasn't yet been written for a specific function.
It means the dev has to finish development
This is akin to an HTTP 501, GRPC Internal (12)

func (NotImplementedError) Error

func (e NotImplementedError) Error() string

func (NotImplementedError) Type

type ObjectNotInContextError

type ObjectNotInContextError struct {
	Object string
}

func (*ObjectNotInContextError) Error

func (e *ObjectNotInContextError) Error() string

type ResourceConflictError

type ResourceConflictError struct{}

ResourceConflictError

This error is raised if the resource you're trying to access doesn't exists (whether it is an url or a specific object)
This is akin to an HTTP 409, GRPC AlreadyExists (6)

func (ResourceConflictError) Error

func (e ResourceConflictError) Error() string

func (ResourceConflictError) Type

type ResourceNotFoundError

type ResourceNotFoundError struct{}

ResourceNotFoundError

This error is raised if the resource you're trying to access doesn't exists (whether it is an url or a specific object)
This is akin to an HTTP 404, GRPC NotFound (5)

func (ResourceNotFoundError) Error

func (e ResourceNotFoundError) Error() string

func (ResourceNotFoundError) Type

type TypedError

type TypedError interface {
	Type() ErrorType
}

type UnauthorizedError

type UnauthorizedError struct{}

UnauthorizedError

This error is raised if you don't have the rights to access a ressource
This is akin to an HTTP 403, GRPC PermissionDenied (7)

func (UnauthorizedError) Error

func (e UnauthorizedError) Error() string

func (UnauthorizedError) Type

func (e UnauthorizedError) Type() ErrorType

type UnavailableServiceError

type UnavailableServiceError struct{}

UnavailableServiceError

This error should be raised if the service tried to call another service but it failed to respond
It can be if the service wasn't reached or closed the connection unexpectedly
This is akin to an HTTP 503, GRPC Unavailable (14)

func (UnavailableServiceError) Error

func (e UnavailableServiceError) Error() string

func (UnavailableServiceError) Type

type WrongObjectTypeInContextError

type WrongObjectTypeInContextError struct {
	Object       string
	ExpectedType string
}

func (*WrongObjectTypeInContextError) Error

Jump to

Keyboard shortcuts

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