Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsLedgerError ¶
IsLedgerError returns true if the error is of type LedgerError.
Types ¶
type ErrLedger ¶
type ErrLedger string
const ( // ErrRequestInvalid is returned when the request is invalid. ErrRequestInvalid ErrLedger = "RequestError_INVALID_REQUEST" // ErrRequestIllegal is returned when the requestor is not authenticated to perform the request. ErrRequestIllegal ErrLedger = "RequestError_ILLEGAL_REQUEST" // ErrRequestForbidden is returned when the requestor is not authorized to perform the request. ErrRequestForbidden ErrLedger = "RequestError_FORBIDDEN" // ErrInternal is returned when an internal error occurs. ErrInternal ErrLedger = "RequestError_INTERNAL" // ErrRecordNotFound is returned when a requested record is not found in the repository. ErrRecordNotFound ErrLedger = "RepositoryError_RECORD_NOT_FOUND" // ErrRecordInsertConflict is returned when there is a conflict while inserting a record into the repository, such as a duplicate entry. ErrRecordInsertConflict ErrLedger = "RepositoryError_RECORD_INSERT_CONFLICT" // ErrRepositoryInternal is returned when an internal error occurs within the repository, such as a database failure. ErrRepositoryInternal ErrLedger = "RepositoryError_INTERNAL" )
type LedgerError ¶
func AsLedgerError ¶
func AsLedgerError(err error) LedgerError
AsLedgerError returns the error as a LedgerError.
func NewLedgerError ¶
func NewLedgerError(code ErrLedger, message string) LedgerError
func (LedgerError) Error ¶
func (e LedgerError) Error() string
Click to show internal directories.
Click to hide internal directories.