Documentation ¶
Overview ¶
Package actionerror defines the types and functions for structured handling of action errors within a Darlean cluster.
Index ¶
Constants ¶
const ERROR_KIND_APPLICATION = Kind("application")
const ERROR_KIND_FRAMEWORK = Kind("framework")
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Error ¶
type Error struct { Code string `json:"code"` Message string `json:"message"` Template string `json:"template"` Kind Kind `json:"kind"` Parameters map[string]any `json:"parameters"` Nested []*Error `json:"nested"` Stack string `json:"stack"` }
Error represents an error that occurred while invoking an action.
Action errors can either be application errors (that occurred in application logic) or framework errors (that occurred within Darlean, like for network errors).
Action errors are serializable and can passed to and understood by remote actors, even in different languages.
func New ¶
Returns a new application action error for the specified options. Application code is encouraged to use this mechanism instead of regular errors, because it provides a consistent way of propagating errors throughout the Darlean cluster.