modulepackage
0.0.9
Repository: https://github.com/thestoicway/custom_errors.git
Documentation: pkg.go.dev
# Functions
HandlerWrapper is a middleware that wraps the handler with a function that handles errors and returns a unified response.
NewDuplicateEmailError returns an error that should be used when the user tries to register with an email that is already in the system.
NewErrorResponse creates a new error response.
No description provided by the author
NewSuccessResponse creates a new success response.
NewUnauthorizedError returns an error that should be used when the user is not authorized to perform the operation.
NewWrongCredentialsError returns a new error with the given message.
NewWrongInputError returns a new error with the given message.
# Constants
ErrDuplicateEmail is returned when the user tries to register with an email that is already in the system.
ErrUnauthorized is returned when the user is not authorized to perform the operation.
ErrUnknown is an unknown error.
ErrWrongCredentials is returned when the user provides wrong credentials.
ErrWrongInput is returned when wrong input is provided.
# Structs
CustomError represents a custom error.
ErrorInfo represents detailed error information.
UnifiedResponse represents the standard response format for all responses.
# Type aliases
No description provided by the author