-
Notifications
You must be signed in to change notification settings - Fork 6
/
error.go
77 lines (60 loc) · 2.02 KB
/
error.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package oidc
import (
"github.com/giantswarm/microerror"
)
var invalidChallengeError = µerror.Error{
Kind: "invalidChallengeError",
}
// IsInvalidChallenge asserts invalidChallengeError.
func IsInvalidChallenge(err error) bool {
return microerror.Cause(err) == invalidChallengeError
}
var cannotDecodeTokenError = µerror.Error{
Kind: "cannotDecodeTokenError",
}
// IsCannotDecodeToken asserts cannotDecodeTokenError.
func IsCannotDecodeToken(err error) bool {
return microerror.Cause(err) == cannotDecodeTokenError
}
var cannotRenewTokenError = µerror.Error{
Kind: "cannotRenewTokenError",
}
// IsCannotRenewToken asserts cannotRenewTokenError.
func IsCannotRenewToken(err error) bool {
return microerror.Cause(err) == cannotRenewTokenError
}
var cannotGetDeviceCodeError = µerror.Error{
Kind: "cannotGetDeviceCodeError",
}
// IsCannotGetDeviceCodeError asserts cannotGetDeviceCodeError.
func IsCannotGetDeviceCodeError(err error) bool {
return microerror.Cause(err) == cannotGetDeviceCodeError
}
var cannotGetDeviceTokenError = µerror.Error{
Kind: "cannotGetDeviceTokenError",
}
// IsCannotGetDeviceTokenError asserts cannotGetDeviceTokenError.
func IsCannotGetDeviceTokenError(err error) bool {
return microerror.Cause(err) == cannotGetDeviceTokenError
}
var cannotParseJwtError = µerror.Error{
Kind: "cannotParseJwtError",
}
// IsCannotParseJwtError asserts cannotParseJwtError.
func IsCannotParseJwtError(err error) bool {
return microerror.Cause(err) == cannotParseJwtError
}
var authorizationPendingError = µerror.Error{
Kind: "authorizationPendingError",
}
// IsAuthorizationPendingError asserts authorizationPendingError.
func IsAuthorizationPendingError(err error) bool {
return microerror.Cause(err) == authorizationPendingError
}
var tooManyAuthRequestsError = µerror.Error{
Kind: "tooManyAuthRequestsError",
}
// IsTooManyAuthRequestsError asserts tooManyAuthRequestsError.
func IsTooManyAuthRequestsError(err error) bool {
return microerror.Cause(err) == tooManyAuthRequestsError
}