Versions in this module Expand all Collapse all v1 v1.3.4 Mar 17, 2026 v1.3.3 Mar 17, 2026 v1.3.2 Mar 13, 2026 v1.3.1 Mar 10, 2026 v1.3.0 Mar 10, 2026 v1.2.1 Mar 10, 2026 v1.2.0 Mar 9, 2026 v1.1.1 Mar 9, 2026 v1.1.0 Mar 9, 2026 Changes in this version + var BadGateway = Register(2007, "BAD_GATEWAY").WithHTTP(http.StatusBadGateway) + var Forbidden = Register(2004, "FORBIDDEN").WithHTTP(http.StatusForbidden) + var Timeout = Register(2006, "TIMEOUT").WithHTTP(http.StatusGatewayTimeout) + var Unauthorized = Register(2003, "UNAUTHORIZED").WithHTTP(http.StatusUnauthorized) + func Code(err error) int + func HTTPCode(err error) int + func Name(err error) string + type Definition struct + Class *Definition + Code int + HTTP int + Name string + func NewDefinition(name string) *Definition + func Register(code int, name string) *Definition + func (d *Definition) Error() string + func (d *Definition) New(msg string) error + func (d *Definition) Newf(format string, args ...interface{}) error + func (d *Definition) WithHTTP(code int) *Definition + func (d *Definition) Wrap(cause error, msg string) error + func (d *Definition) Wrapf(cause error, format string, args ...interface{}) error + type ErrorInfo struct + Class string + Code int + Name string + func Export() []ErrorInfo + type Registry struct + func NewRegistry() *Registry + func (r *Registry) Export() []ErrorInfo + func (r *Registry) New(name string) *Definition + func (r *Registry) Register(code int, name string) *Definition v1.0.2 Dec 24, 2025 v1.0.1-beta.1 Oct 22, 2025 v1.0.0 Jul 25, 2025 Changes in this version + var As = stderrors.As + var CodeConflict = ErrorCode + var CodeDatabaseError = ErrorCode + var CodeDuplicateKey = ErrorCode + var CodeExternalServiceError = ErrorCode + var CodeForbidden = ErrorCode + var CodeForeignKeyViolation = ErrorCode + var CodeInternalServer = ErrorCode + var CodeInvalidParam = ErrorCode + var CodeInvalidPassword = ErrorCode + var CodeNetworkError = ErrorCode + var CodeNotFound = ErrorCode + var CodeRecordNotFound = ErrorCode + var CodeTimeoutError = ErrorCode + var CodeTokenExpired = ErrorCode + var CodeTokenInvalid = ErrorCode + var CodeTooManyRequests = ErrorCode + var CodeUnauthorized = ErrorCode + var CodeUserExists = ErrorCode + var CodeUserNotFound = ErrorCode + var ErrUnsupported = stderrors.ErrUnsupported + var Join = stderrors.Join + var StdIs = stderrors.Is + var StdUnwrap = stderrors.Unwrap + func GetContext(err error) map[string]interface + func GetStack(err error) string + func Is(err error, code ErrorCode) bool + func IsConflict(err error) bool + func IsDatabaseError(err error) bool + func IsExternalServiceError(err error) bool + func IsForbidden(err error) bool + func IsInternalServer(err error) bool + func IsInvalidParam(err error) bool + func IsNotFound(err error) bool + func IsTooManyRequests(err error) bool + func IsUnauthorized(err error) bool + func Unwrap(err error) error + type Error struct + Cause error + Code ErrorCode + Context map[string]interface{} + Details string + Message string + Stack string + func Internal(message ...string) *Error + func InvalidParam(message ...string) *Error + func New(code ErrorCode, message ...string) *Error + func NewWithDetails(code ErrorCode, message string, details string) *Error + func Newf(code ErrorCode, format string, args ...interface{}) *Error + func NotFound(message ...string) *Error + func Wrap(err error, code ErrorCode, message ...string) *Error + func WrapWithDetails(err error, code ErrorCode, message string, details string) *Error + func Wrapf(err error, code ErrorCode, format string, args ...interface{}) *Error + func (e *Error) Error() string + func (e *Error) GetMessage() string + func (e *Error) Unwrap() error + func (e *Error) WithContext(key string, value interface{}) *Error + func (e *Error) WithDetails(details string) *Error + func (e *Error) WithMessage(message string) *Error + func (e *Error) WithStack() *Error + type ErrorCode struct + Code int + DefaultMessage string + Name string + func GetCode(err error) ErrorCode + func NewErrorCode(code int, name string, defaultMessage ...string) ErrorCode + func StringToCode(s string) ErrorCode + func StringToCodeWithFound(s string) (ErrorCode, bool) + func (ec *ErrorCode) UnmarshalJSON(data []byte) error + func (ec ErrorCode) Equal(other ErrorCode) bool + func (ec ErrorCode) GetDefaultMessage() string + func (ec ErrorCode) MarshalJSON() ([]byte, error) + func (ec ErrorCode) String() string