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
GetDetails extracts the reason and metadata from the given gRPC error, if available.
func NewGrpcErrorWithDetails ¶ added in v0.8.1
NewGrpcErrorWithDetails creates a gRPC error with the given status and metadata mapping.
func WithMetadata ¶ added in v0.8.1
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.
Click to show internal directories.
Click to hide internal directories.