forked from fasthttp/router
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherrors.go
27 lines (22 loc) · 832 Bytes
/
errors.go
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 radix
import (
"fmt"
)
const (
errSetHandler = "a handler is already registered for path '%s'"
errSetWildcardHandler = "a wildcard handler is already registered for path '%s'"
errWildPathConflict = "'%s' in new path '%s' conflicts with existing wild path '%s' in existing prefix '%s'"
errWildcardConflict = "'%s' in new path '%s' conflicts with existing wildcard '%s' in existing prefix '%s'"
errWildcardSlash = "no / before wildcard in path '%s'"
errWildcardNotAtEnd = "wildcard routes are only allowed at the end of the path in path '%s'"
)
type radixError struct {
msg string
params []interface{}
}
func (err radixError) Error() string {
return fmt.Sprintf(err.msg, err.params...)
}
func newRadixError(msg string, params ...interface{}) radixError {
return radixError{msg, params}
}