statuscode

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package statuscode defines transport-neutral error codes shared by storage backends and embedded clients. The server-only adapter maps these errors to gRPC statuses without making gRPC a dependency of embedded binaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf

func Errorf(code Code, format string, args ...any) error

func FromContextError

func FromContextError(err error) error

func New

func New(code Code, message string) error

Types

type Code

type Code uint8
const (
	OK Code = iota
	Unknown
	Canceled
	InvalidArgument
	DeadlineExceeded
	NotFound
	AlreadyExists
	PermissionDenied
	Unauthenticated
	Unavailable
	Unimplemented
	FailedPrecondition
	Internal
)

func CodeOf

func CodeOf(err error) Code

func FromError

func FromError(err error) (Code, string, bool)

type Error

type Error struct {
	// contains filtered or unexported fields
}

func (*Error) Code

func (e *Error) Code() Code

func (*Error) Error

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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