forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
error.go
35 lines (31 loc) · 958 Bytes
/
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
package osincli
const (
E_INVALID_REQUEST string = "invalid_request"
E_UNAUTHORIZED_CLIENT = "unauthorized_client"
E_ACCESS_DENIED = "access_denied"
E_UNSUPPORTED_RESPONSE_TYPE = "unsupported_response_type"
E_INVALID_SCOPE = "invalid_scope"
E_SERVER_ERROR = "server_error"
E_TEMPORARILY_UNAVAILABLE = "temporarily_unavailable"
E_UNSUPPORTED_GRANT_TYPE = "unsupported_grant_type"
E_INVALID_GRANT = "invalid_grant"
E_INVALID_CLIENT = "invalid_client"
)
// OAuth2 error base
type Error struct {
Id string
Description string
URI string
State string
}
func (e *Error) Error() string {
return e.Description
}
func NewError(id, description, uri, state string) *Error {
return &Error{
Id: id,
Description: description,
URI: uri,
State: state,
}
}