1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
package locale
import (
"errors"
)
var (
// ErrNotDetected returns while no locale detected.
ErrNotDetected = errors.New("not detected")
// ErrNotSupported means current platform or language is not supported.
ErrNotSupported = errors.New("not supported")
)
// Error is the error returned by locale.
type Error struct {
Op string
Err error
}
func (e *Error) Error() string {
return e.Op + ": " + e.Err.Error()
}
// Unwrap implements xerrors.Wrapper
func (e *Error) Unwrap() error {
return e.Err
}
|