errors

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReasonMissingFields   = "MISSING_FIELDS"    // Data is missing required fields
	ReasonCannotParseData = "CANNOT_PARSE_DATA" // Data could not be parsed
)
View Source
const (
	MetadataMissingFields = "missingFields" // Comma-separated list of missing fields
)

Variables

View Source
var (
	// StatusProviderAuthenticationError indicates a failure to authenticate with the keystore provider.
	StatusProviderAuthenticationError = status.New(
		codes.InvalidArgument, "failed to authenticate with the keystore provider")

	// StatusInvalidKeyAccessData indicates that the provided key access data (management or crypto) is invalid.
	StatusInvalidKeyAccessData = status.New(
		codes.InvalidArgument, "invalid key access data")

	// StatusKeyNotFound indicates that the specified key was not found in the keystore provider.
	StatusKeyNotFound = status.New(
		codes.NotFound, "key not found in the keystore provider")
)

Predefined gRPC status errors for common keystore error scenarios.

Functions

func GetDetails added in v0.8.1

func GetDetails(err error) (string, map[string]string)

GetDetails extracts the reason and metadata from the given gRPC error, if available.

func IsStatus

func IsStatus(err error, st *status.Status) bool

IsStatus checks if the given error matches the provided gRPC status.

func NewGrpcErrorWithDetails added in v0.8.1

func NewGrpcErrorWithDetails(st *status.Status, reason string, metadata map[string]string) error

NewGrpcErrorWithDetails creates a gRPC error with the given status and metadata mapping.

func WithMetadata added in v0.8.1

func WithMetadata(err error, metadata map[string]string) error

WithMetadata adds additional metadata to an existing gRPC error. If the error does not contain gRPC status information, it is returned unchanged. If the error already has metadata, the new metadata is merged in, with new values overwriting existing ones.

Types

This section is empty.

Jump to

Keyboard shortcuts

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