Compare commits

..

No commits in common. "main" and "v0.0.1" have entirely different histories.
main ... v0.0.1

1 changed files with 0 additions and 17 deletions

View File

@ -15,7 +15,6 @@ const (
ErrorTypeInternal ErrorType = "INTERNAL"
ErrorTypeUnauthorized ErrorType = "UNAUTHORIZED"
ErrorTypeForbidden ErrorType = "FORBIDDEN"
ErrorTypeNetwork ErrorType = "NETWORK"
)
// AppError - кастомная ошибка приложения
@ -68,14 +67,6 @@ func NewNotFoundError(message string) *AppError {
}
}
func NewNetworkError(message string) *AppError {
return &AppError{
Type: ErrorTypeNetwork,
Message: message,
Code: 0, // Network errors don't have HTTP codes
}
}
func NewInternalError(message string) *AppError {
return &AppError{
Type: ErrorTypeInternal,
@ -117,14 +108,6 @@ func IsConflict(err error) bool {
return false
}
func IsNetworkError(err error) bool {
var appErr *AppError
if errors.As(err, &appErr) {
return appErr.Type == ErrorTypeNetwork
}
return false
}
// Wrap оборачивает ошибку с сообщением
func Wrap(err error, message string) error {
return fmt.Errorf("%s: %w", message, err)