Documentation
¶
Index ¶
- func AlreadyExists(ctx context.Context, message string, field string, conflictValue string) error
- func Internal(ctx context.Context, message string, reason string, domain string) error
- func InvalidArgument(ctx context.Context, message string, violations ...FieldViolation) error
- func NotFound(ctx context.Context, resourceType string, resourceID string) error
- func PreconditionFailed(ctx context.Context, message string, violationType string, subject string, ...) error
- func RateLimited(ctx context.Context, message string, retryAfter time.Duration) error
- func WithHelp(err error, links ...*errdetails.Help_Link) error
- func WithLocalizedMessage(err error, locale string, localizedMessage string) error
- type FieldViolation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlreadyExists ¶
AlreadyExists returns a gRPC error indicating a resource already exists Includes precondition failure details for the conflicting field
func Internal ¶
Internal returns a gRPC internal error with debug info Includes error info with reason and domain for categorization
func InvalidArgument ¶
func InvalidArgument(ctx context.Context, message string, violations ...FieldViolation) error
InvalidArgument returns a gRPC error with structured field violations Use this for validation errors where specific fields failed validation
func NotFound ¶
NotFound returns a gRPC error indicating a resource was not found Includes resource info for the missing resource
func PreconditionFailed ¶
func PreconditionFailed(ctx context.Context, message string, violationType string, subject string, description string) error
PreconditionFailed returns a gRPC error for failed preconditions Use when an operation cannot proceed due to the current state of the resource
func RateLimited ¶
RateLimited returns a gRPC error indicating rate limiting Includes retry information with the recommended retry delay
Types ¶
type FieldViolation ¶
FieldViolation represents a validation error for a specific field