goshort/internal/errs/errors.go

22 lines
482 B
Go
Raw Normal View History

2023-08-17 14:14:59 -03:00
package errs
import (
"errors"
"fmt"
)
var (
// ErrInvalidConfig is returned when the configuration is invalid.
ErrInvalidConfig = errors.New("invalid configuration")
// ErrInvalidShort
ErrInvalidShort = errors.New("invalid short")
// ErrShortDoesNotExist
ErrShortDoesNotExist = errors.New("short does not exist")
// ErrShortExists
ErrShortExists = errors.New("short already exists")
)
func Error(err error, msg string) error {
return fmt.Errorf("%w: %s", err, msg)
}