domain

package
v0.0.0-...-e6240ef Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VALIDATION_ERROR         = NewErrorCode(400, "VALIDATION_ERROR", "")
	USER_CREATE_ERROR        = NewErrorCode(4001, "USER_CREATE_ERROR", "cant create user")
	USER_READ_ERROR          = NewErrorCode(4002, "USER_READ_ERROR", "cant read user")
	NOTE_CREATE_ERROR        = NewErrorCode(4003, "NOTE_CREATE_ERROR", "cant create note")
	NOTE_DELETE_ERROR        = NewErrorCode(4004, "NOTE_DELETE_ERROR", "cant delete note")
	NOTE_UPDATE_ERROR        = NewErrorCode(4005, "NOTE_UPDATE_ERROR", "cant update note")
	NOTE_READ_ERROR          = NewErrorCode(4006, "NOTE_READ_ERROR", "cant read note")
	NO_NOTE_ERROR            = NewErrorCode(4007, "NO_NOTE_ERROR", "note not available")
	NO_USER_ERROR            = NewErrorCode(4008, "NO_USER_ERROR", "user not available")
	NOTE_ACCESS_DENIED_ERROR = NewErrorCode(4009, "NOTE_ACCESS_DENIED_ERROR", "note access denied for current user")
)

Functions

This section is empty.

Types

type Error

type Error struct {
	Code    int64
	Key     string
	Details []ErrorDetails
}

func FromError

func FromError(message string, err error) *Error

func FromErrorCode

func FromErrorCode(code ErrorCode, details string, metadata interface{}) *Error

func NewError

func NewError(code int64, key string, message string, details string, metadata []interface{}) *Error

func (*Error) CascadeError

func (e *Error) CascadeError(message string, err error) *Error

func (*Error) CascadeErrorCode

func (e *Error) CascadeErrorCode(code ErrorCode, details string, metadata interface{}) *Error

func (*Error) Error

func (e *Error) Error() string

type ErrorCode

type ErrorCode struct {
	Code    int64
	Key     string
	Message string
}

func NewErrorCode

func NewErrorCode(code int64, key string, message string) ErrorCode

type ErrorDetails

type ErrorDetails struct {
	Message  string
	Details  string
	Metadata interface{}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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