errors

package
v1.4.32 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 License: MIT Imports: 5 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AccessDeniedError = NewServiceError(model.ErrorCode_ACCESS_DENIED, "Access denied", codes.PermissionDenied)
View Source
var AlreadyExistsError = NewServiceError(model.ErrorCode_ALREADY_EXISTS, "Already Exists", codes.FailedPrecondition)

RecordValidationError @fixme

View Source
var AuthenticationFailedError = NewServiceError(model.ErrorCode_AUTHENTICATION_FAILED, "Authentication failed", codes.Unauthenticated)
View Source
var BackendConnectionAuthenticationError = NewServiceError(model.ErrorCode_BACKEND_ERROR, "Backend error", codes.FailedPrecondition)
View Source
var ExternalBackendCommunicationError = NewServiceError(model.ErrorCode_EXTERNAL_BACKEND_COMMUNICATION_ERROR, "External Backend communication error", codes.Internal)
View Source
var ExternalBackendError = NewServiceError(model.ErrorCode_EXTERNAL_BACKEND_ERROR, "External Backend error", codes.Internal)
View Source
var InternalError = NewServiceError(model.ErrorCode_INTERNAL_ERROR, "Internal error", codes.Internal)
View Source
var PropertyNotFoundError = NewServiceError(model.ErrorCode_PROPERTY_NOT_FOUND, "Property not found", codes.FailedPrecondition)
View Source
var RecordNotFoundError = NewServiceError(model.ErrorCode_RECORD_NOT_FOUND, "record not found", codes.NotFound)
View Source
var RecordValidationError = NewServiceError(model.ErrorCode_RECORD_VALIDATION_ERROR, "Record Validation failed", codes.FailedPrecondition)
View Source
var ReferenceViolation = NewServiceError(model.ErrorCode_REFERENCE_VIOLATION, "Reference violation", codes.FailedPrecondition)
View Source
var ResourceNotFoundError = NewServiceError(model.ErrorCode_RESOURCE_NOT_FOUND, "resource not found", codes.NotFound)
View Source
var ResourceValidationError = NewServiceError(model.ErrorCode_RESOURCE_VALIDATION_ERROR, "resource Validation failed", codes.FailedPrecondition)
View Source
var UnableToLocatePrimaryKey = NewServiceError(model.ErrorCode_UNABLE_TO_LOCATE_PRIMARY_KEY, "unable to locate primary key", codes.FailedPrecondition)
View Source
var UnsupportedOperation = NewServiceError(model.ErrorCode_UNSUPPORTED_OPERATION, "Unsupported Operation", codes.FailedPrecondition)

Functions

This section is empty.

Types

type ServiceError

type ServiceError interface {
	Code() model.ErrorCode
	Error() string
	ProtoError() *model.Error
	WithMessage(msg string) ServiceError
	WithDetails(details string) ServiceError
	WithErrorFields(errors []*model.ErrorField) ServiceError
	GetDetails() string
	Is(err error) bool
	GetGrpcErrorCode() codes.Code
	GetFullMessage() string
}

func FromGrpcError added in v1.3.67

func FromGrpcError(err error) ServiceError

func FromProtoError added in v1.1.48

func FromProtoError(err *model.Error) ServiceError

func FromServiceError added in v1.3.84

func FromServiceError(err error) ServiceError

func NewServiceError added in v1.1.48

func NewServiceError(code model.ErrorCode, message string, grpcErrorCode codes.Code) ServiceError

Jump to

Keyboard shortcuts

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