errors

package
v1.12.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AccessControlError = func(d string) XrpcError {
	return NewXrpcError(
		WithTag("AccessControl"),
		WithError(fmt.Errorf("DID does not have sufficent access permissions for this operation: %s", d)),
	)
}
View Source
var AuthError = func(err error) XrpcError {
	return NewXrpcError(
		WithTag("Auth"),
		WithError(fmt.Errorf("signature verification failed: %w", err)),
	)
}
View Source
var GitError = func(e error) XrpcError {
	return NewXrpcError(
		WithTag("Git"),
		WithError(fmt.Errorf("git error: %w", e)),
	)
}
View Source
var InvalidRepoError = func(r string) XrpcError {
	return NewXrpcError(
		WithTag("InvalidRepo"),
		WithError(fmt.Errorf("supplied at-uri is not a repo: %s", r)),
	)
}
View Source
var MissingActorDidError = NewXrpcError(
	WithTag("MissingActorDid"),
	WithMessage("actor DID not supplied"),
)
View Source
var OwnerNotFoundError = NewXrpcError(
	WithTag("OwnerNotFound"),
	WithMessage("owner not set for this service"),
)
View Source
var RecordExistsError = func(r string) XrpcError {
	return NewXrpcError(
		WithTag("RecordExists"),
		WithError(fmt.Errorf("repo already exists: %s", r)),
	)
}
View Source
var RefNotFoundError = NewXrpcError(
	WithTag("RefNotFound"),
	WithMessage("failed to access ref"),
)
View Source
var RepoExistsError = func(r string) XrpcError {
	return NewXrpcError(
		WithTag("RepoExists"),
		WithError(fmt.Errorf("repo already exists: %s", r)),
	)
}
View Source
var RepoNotFoundError = NewXrpcError(
	WithTag("RepoNotFound"),
	WithMessage("failed to access repository"),
)

Functions

This section is empty.

Types

type ErrOpt

type ErrOpt = func(xerr *XrpcError)

func WithError

func WithError(e error) ErrOpt

func WithMessage

func WithMessage[S ~string](s S) ErrOpt

func WithTag

func WithTag(tag string) ErrOpt

type XrpcError

type XrpcError struct {
	Tag     string `json:"error"`
	Message string `json:"message"`
}

func GenericError

func GenericError(err error) XrpcError

func NewXrpcError

func NewXrpcError(opts ...ErrOpt) XrpcError

func Unmarshal

func Unmarshal(errStr string) (XrpcError, error)

func (XrpcError) Error

func (x XrpcError) Error() string

Source Files

  • errors.go

Jump to

Keyboard shortcuts

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