Documentation
¶
Overview ¶
Package errorstate contains structs to keep multiple error details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Detail ¶
type Detail struct { // Domain is unique identifier for the use case raising this error. // This helps distinguish usecase-specific errors. Domain string `json:"domain,omitempty"` // Indicates how the location property should be interpreted. Type string `json:"type,omitempty"` // The location of the error (the interpretation of its value depends on type). Location string `json:"location,omitempty"` // Unique identifier for this error. Reason string `json:"reason,omitempty"` // A human readable message providing more details about the error. Message string `json:"message,omitempty"` }
Detail contains information about error specifics.
type ErrorState ¶
type ErrorState struct { // Domain is unique identifier for the use case raising this error. Domain string `json:"-"` // Error details accociated with this error. Errors []*Detail `json:"errors,omitempty"` }
ErrorState contains information about domain raising this error and any accociated error details.
func (*ErrorState) Error ¶
func (e *ErrorState) Error() string
Error returns a string representation.
func (*ErrorState) OrNil ¶
func (e *ErrorState) OrNil() error
OrNil returns nil if there is no errors added to this state, otherwise returns error.
Click to show internal directories.
Click to hide internal directories.