package
Version:
v0.0.0-...-a4f76d6
Opens a new window with list of versions in this module.
Published: Aug 24, 2025
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package errors defines custom error types.
pkg/errors/codes.go
Package errors defines custom error types.
pkg/errors/errors.go
IsCode checks if an error is an AppError with a specific ErrorCode.
New creates a new AppError with a given code and message.
Wrap creates a new AppError that wraps an existing error.
AppError is a custom error type that includes an application-specific error code.
IsAppError checks if an error is an AppError and returns it.
Error implements the error interface for AppError.
Unwrap returns the underlying error, allowing errors.Is and errors.As to work.
ErrorCode represents a unique application-specific error code.
const (
ErrCodeUnknown ErrorCode = iota
ErrCodeInvalidInput
ErrCodeNotFound
ErrCodeUnauthorized
ErrCodeForbidden
ErrCodeInternal
ErrCodeServiceUnavailable
ErrCodeConfigLoadFailed
ErrCodeConfigValidationFailed
ErrCodeNetworkConnectionFailed
ErrCodeTimeout
)
Code returns the ErrorCode of an AppError, or ErrCodeUnknown if not an AppError.
String returns the string representation of the ErrorCode.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.