-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
31 lines (26 loc) · 1.16 KB
/
Copy patherrors.go
File metadata and controls
31 lines (26 loc) · 1.16 KB
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
28
29
30
31
package wordnumber
import "fmt"
// Error is the error type returned from this package
type Error string
// Error implements the Error interface
func (e Error) Error() string {
return string(e)
}
// With supplies parameters to error messages
func (e Error) With(p ...interface{}) Error {
return Error(fmt.Sprintf(string(e), p...))
}
// Possible errors returned from this package
const (
ErrNotImplemented Error = "method '%s' is not yet implemented"
ErrOutOfRange Error = "number out of range"
ErrNegative Error = "cannot represent negative numbers"
ErrFmtOverflow Error = "cannot represent numbers greater than %d"
ErrUnknownConversion Error = "unknown conversion method %s"
ErrParseCardinal Error = "unknown word '%s' in expression, can't parse as a cardinal number"
ErrParseOrdinal Error = "unknown word '%s' in expression, can't parse as an ordinal number"
ErrParseShortOrdinal Error = "can't parse '%s' as a short ordinal number"
ErrBadRoman Error = "unexpected character parsing roman numerals"
ErrParseInit Error = "could not process '%s' as an integer"
ErrNoInput Error = "no input was provided"
)