Creates a new ServiceError
Issues contributing to the error or a message string
Optional
causeReadonly
idReadonly
issuesReadonly
sourceOptional
stackReadonly
statusStatic
Optional
prepareOptional override for formatting stack traces
Static
stackConverts the error to JSON:API format
Object conforming to JSON:API error format
Static
captureStatic
fromConverts an unknown value to a ServiceError
. Typically called from catch
blocks.
The value to convert, which can be any type
If the value is already a ServiceError
, returns it unchanged. Otherwise, convert it
to a ServiceError
.
Static
fromConverts a ZodError to a ServiceError
.
A ZodError
Optional
options: { source?: ErrorSource }The converted ServiceError
Error class for service-level errors, convertible to JSON:API errors.