22 lines
482 B
Go
22 lines
482 B
Go
|
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)
|
||
|
}
|