serviceerror

package
v0.2.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromError

func FromError(err error, extraDetails ...*anypb.Any) error

FromError converts wraps an error with Error if necessary. The client should not use this function. It is called by built-in interceptor.

func FromRPCError

func FromRPCError(err error, md *metadata.MD, extraDetails ...*anypb.Any) error

FromRPCError converts wraps an error with Error if necessary. It also extracts request ID from metadata if available. The client should not use this function. It is called by a built-in interceptor.

func StreamClientInterceptor

func StreamClientInterceptor(
	ctx context.Context,
	desc *grpc.StreamDesc,
	cc *grpc.ClientConn,
	method string,
	streamer grpc.Streamer,
	opts ...grpc.CallOption,
) (grpc.ClientStream, error)

func UnaryClientInterceptor

func UnaryClientInterceptor(
	ctx context.Context,
	method string,
	req, reply any,
	cc *grpc.ClientConn,
	invoker grpc.UnaryInvoker,
	opts ...grpc.CallOption,
) error

Types

type BadRequest

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

func (*BadRequest) Code

func (e *BadRequest) Code() string

func (*BadRequest) Proto

func (e *BadRequest) Proto() *common.ServiceError

func (*BadRequest) RetryType

func (e *BadRequest) RetryType() common.ServiceError_RetryType

func (*BadRequest) Service

func (e *BadRequest) Service() string

func (*BadRequest) String

func (e *BadRequest) String() string

func (*BadRequest) Violations

func (e *BadRequest) Violations() []*common.BadRequest_Violation

type BadResourceState

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

func (*BadResourceState) Code

func (e *BadResourceState) Code() string

func (*BadResourceState) Message

func (e *BadResourceState) Message() string

func (*BadResourceState) Proto

func (e *BadResourceState) Proto() *common.ServiceError

func (*BadResourceState) ResourceID

func (e *BadResourceState) ResourceID() string

func (*BadResourceState) RetryType

func (e *BadResourceState) RetryType() common.ServiceError_RetryType

func (*BadResourceState) Service

func (e *BadResourceState) Service() string

func (*BadResourceState) String

func (e *BadResourceState) String() string

type Detail

type Detail interface {
	String() string
	Proto() *common.ServiceError
	Service() string
	Code() string
	RetryType() common.ServiceError_RetryType
}

Detail is a wrapper for protobuf message nebius.common.v1.ServiceError.

Here is the list of possible detail types:

func NewDetail

func NewDetail(serviceError *common.ServiceError) Detail

NewDetail converts protobuf message to Detail.

func NewDetailFromAny

func NewDetailFromAny(detail *anypb.Any) (Detail, error)

NewDetailFromAny converts protobuf anypb.Any message to Detail.

type Error

type Error struct {
	Wrapped   error
	Details   []Detail
	RequestID string
}

Error is a wrapper returned by gRPC services if an original error contains Detail. It also contains request ID if it is present.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type Internal

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

func (*Internal) Code

func (e *Internal) Code() string

func (*Internal) Proto

func (e *Internal) Proto() *common.ServiceError

func (*Internal) RequestID

func (e *Internal) RequestID() string

func (*Internal) RetryType

func (e *Internal) RetryType() common.ServiceError_RetryType

func (*Internal) Service

func (e *Internal) Service() string

func (*Internal) String

func (e *Internal) String() string

func (*Internal) TraceID

func (e *Internal) TraceID() string

type NotEnoughResources

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

func (*NotEnoughResources) Code

func (e *NotEnoughResources) Code() string

func (*NotEnoughResources) Proto

func (e *NotEnoughResources) Proto() *common.ServiceError

func (*NotEnoughResources) RetryType

func (e *NotEnoughResources) RetryType() common.ServiceError_RetryType

func (*NotEnoughResources) Service

func (e *NotEnoughResources) Service() string

func (*NotEnoughResources) String

func (e *NotEnoughResources) String() string

func (*NotEnoughResources) Violations

type OperationAborted

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

func (*OperationAborted) AbortedOperationID

func (e *OperationAborted) AbortedOperationID() string

func (*OperationAborted) Code

func (e *OperationAborted) Code() string

func (*OperationAborted) NewOperationID

func (e *OperationAborted) NewOperationID() string

func (*OperationAborted) Proto

func (e *OperationAborted) Proto() *common.ServiceError

func (*OperationAborted) ResourceID

func (e *OperationAborted) ResourceID() string

func (*OperationAborted) RetryType

func (e *OperationAborted) RetryType() common.ServiceError_RetryType

func (*OperationAborted) Service

func (e *OperationAborted) Service() string

func (*OperationAborted) String

func (e *OperationAborted) String() string

type OutOfRange

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

func (*OutOfRange) Code

func (e *OutOfRange) Code() string

func (*OutOfRange) Limit

func (e *OutOfRange) Limit() string

func (*OutOfRange) Proto

func (e *OutOfRange) Proto() *common.ServiceError

func (*OutOfRange) Requested

func (e *OutOfRange) Requested() string

func (*OutOfRange) RetryType

func (e *OutOfRange) RetryType() common.ServiceError_RetryType

func (*OutOfRange) Service

func (e *OutOfRange) Service() string

func (*OutOfRange) String

func (e *OutOfRange) String() string

type PermissionDenied

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

func (*PermissionDenied) Code

func (e *PermissionDenied) Code() string

func (*PermissionDenied) Proto

func (e *PermissionDenied) Proto() *common.ServiceError

func (*PermissionDenied) ResourceID

func (e *PermissionDenied) ResourceID() string

func (*PermissionDenied) RetryType

func (e *PermissionDenied) RetryType() common.ServiceError_RetryType

func (*PermissionDenied) Service

func (e *PermissionDenied) Service() string

func (*PermissionDenied) String

func (e *PermissionDenied) String() string

type QuotaFailure

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

func (*QuotaFailure) Code

func (e *QuotaFailure) Code() string

func (*QuotaFailure) Proto

func (e *QuotaFailure) Proto() *common.ServiceError

func (*QuotaFailure) RetryType

func (e *QuotaFailure) RetryType() common.ServiceError_RetryType

func (*QuotaFailure) Service

func (e *QuotaFailure) Service() string

func (*QuotaFailure) String

func (e *QuotaFailure) String() string

func (*QuotaFailure) Violations

func (e *QuotaFailure) Violations() []*common.QuotaFailure_Violation

type ResourceAlreadyExists

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

func (*ResourceAlreadyExists) Code

func (e *ResourceAlreadyExists) Code() string

func (*ResourceAlreadyExists) Proto

func (e *ResourceAlreadyExists) Proto() *common.ServiceError

func (*ResourceAlreadyExists) ResourceID

func (e *ResourceAlreadyExists) ResourceID() string

func (*ResourceAlreadyExists) RetryType

func (e *ResourceAlreadyExists) RetryType() common.ServiceError_RetryType

func (*ResourceAlreadyExists) Service

func (e *ResourceAlreadyExists) Service() string

func (*ResourceAlreadyExists) String

func (e *ResourceAlreadyExists) String() string

type ResourceConflict

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

func (*ResourceConflict) Code

func (e *ResourceConflict) Code() string

func (*ResourceConflict) Message

func (e *ResourceConflict) Message() string

func (*ResourceConflict) Proto

func (e *ResourceConflict) Proto() *common.ServiceError

func (*ResourceConflict) ResourceID

func (e *ResourceConflict) ResourceID() string

func (*ResourceConflict) RetryType

func (e *ResourceConflict) RetryType() common.ServiceError_RetryType

func (*ResourceConflict) Service

func (e *ResourceConflict) Service() string

func (*ResourceConflict) String

func (e *ResourceConflict) String() string

type ResourceNotFound

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

func (*ResourceNotFound) Code

func (e *ResourceNotFound) Code() string

func (*ResourceNotFound) Proto

func (e *ResourceNotFound) Proto() *common.ServiceError

func (*ResourceNotFound) ResourceID

func (e *ResourceNotFound) ResourceID() string

func (*ResourceNotFound) RetryType

func (e *ResourceNotFound) RetryType() common.ServiceError_RetryType

func (*ResourceNotFound) Service

func (e *ResourceNotFound) Service() string

func (*ResourceNotFound) String

func (e *ResourceNotFound) String() string

type TooManyRequests

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

func (*TooManyRequests) Code

func (e *TooManyRequests) Code() string

func (*TooManyRequests) Proto

func (e *TooManyRequests) Proto() *common.ServiceError

func (*TooManyRequests) RetryType

func (e *TooManyRequests) RetryType() common.ServiceError_RetryType

func (*TooManyRequests) Service

func (e *TooManyRequests) Service() string

func (*TooManyRequests) String

func (e *TooManyRequests) String() string

func (*TooManyRequests) Violation

func (e *TooManyRequests) Violation() string

type Unknown

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

func (*Unknown) Code

func (e *Unknown) Code() string

func (*Unknown) IsUnknown

func (e *Unknown) IsUnknown() bool

func (*Unknown) Proto

func (e *Unknown) Proto() *common.ServiceError

func (*Unknown) RetryType

func (e *Unknown) RetryType() common.ServiceError_RetryType

func (*Unknown) Service

func (e *Unknown) Service() string

func (*Unknown) String

func (e *Unknown) String() string

Jump to

Keyboard shortcuts

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