-
Notifications
You must be signed in to change notification settings - Fork 14
/
error.go
36 lines (32 loc) · 1.19 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
package gotwtr
type HTTPError struct {
APIName string
Status string
URL string
}
func (e *HTTPError) Error() string {
return e.APIName + ": " + e.Status + " " + e.URL
}
type APIResponseError struct {
Title string `json:"title"`
Detail string `json:"detail"`
Type string `json:"type"`
ResourceType string `json:"resource_type"`
ResourceID string `json:"resource_id"`
Parameter string `json:"parameter"`
Parameters Parameter `json:"parameters"`
Message string `json:"message"`
Value interface{} `json:"value"`
Reason string `json:"reason,omitempty"`
ClientID string `json:"client_id,omitempty"`
RequiredEnrollment string `json:"required_enrollment,omitempty"`
RegistrationURL string `json:"registration_url,omitempty"`
ConnectionIssue string `json:"connection_issue,omitempty"`
Status int `json:"status,omitempty"`
}
type Parameter struct {
ID []string `json:"id"`
IDs []string `json:"ids"`
UserName []string `json:"username"`
UserNames []string `json:"usernames"`
}