-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherrors.go
32 lines (25 loc) · 910 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
28
29
30
31
32
package kitwalk
import "fmt"
// InvalidUsernameError will be return when given user name is invalid.
type InvalidUsernameError struct {
username string
}
func (e *InvalidUsernameError) Error() string {
return fmt.Sprintf(`Given username '%s' is invalid. For the user name,
combine a prefix such as 'b' or 'm' with the student number
excluding the first digit.`, e.username)
}
// ConfigDoesNotExists will raise when some configurations are missing.
type ConfigDoesNotExists struct{}
func (e *ConfigDoesNotExists) Error() string {
return "Several configuration parameters do not exist."
}
// ShibbolethAuthError will raise when authentication has been failed.
type ShibbolethAuthError struct {
username string
errMsg string
}
func (e *ShibbolethAuthError) Error() string {
return fmt.Sprintf(`Authentication failed.
Given error message from auth page is as follows.\n%+v`, e.errMsg)
}