AppError<ET, E>
Unified error representation Properties
type: string
- error type ID:<module>.<custom_id>
code?: number
- code for use with REST API like404
data?: any
- some extra error context datai18n?: string
- i18n message ID for frontendmessage?: string
- error messageerror?: ET
- Error instance throws from wrapped 3rd codecause?: AppError<Error>
- anotherAppError
object that caused this error
Special errors
IGNORE_ERROR(): AppError
- used when some error can be ignored, but you need return some resultINTERNAL_ERROR(error: Error): AppError
- used for convert errors thrown from 3rd code like database connection error.