Skip to content

Commit 32f803f

Browse files
committed
add error code in error struct
1 parent 85c10c1 commit 32f803f

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

types.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ type Pushy struct {
2828

2929
// Error are simple error responses returned from pushy if request isn't valid
3030
type Error struct {
31+
Code string `json:"code"`
3132
Error string `json:"error"`
3233
}
3334

@@ -133,3 +134,12 @@ type IHTTPClient interface {
133134
Post(string, string, io.Reader) (*http.Response, error)
134135
Do(*http.Request) (*http.Response, error)
135136
}
137+
138+
const (
139+
ErrInvalidParam = "INVALID_PARAM"
140+
ErrInvalidParam = "INVALID_API_KEY"
141+
ErrInvalidParam = "AUTH_LIMIT_EXCEEDED"
142+
ErrInvalidParam = "ACCOUNT_SUSPENDED"
143+
ErrInvalidParam = "RATE_LIMIT_EXCEEDED"
144+
ErrInvalidParam = "INTERNAL_SERVER_ERROR"
145+
)

0 commit comments

Comments
 (0)