-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy patherrors.go
64 lines (41 loc) · 2.38 KB
/
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
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
package main
import "errors"
// ErrUsageLimitExceeded is returned when the usage limit is exceeded.
var ErrUsageLimitExceeded = errors.New("usage limit exceeded")
// auth related
var ErrInvalidCredentials = errors.New("invalid credentials")
var ErrInvalidUserID = errors.New("invalid user id")
/// token related
// ErrTokenExpired is returned when the token is expired.
var ErrTokenExpired = errors.New("token expired")
// ErrTokenNotYetValid is returned when the token is not yet valid.
var ErrTokenNotYetValid = errors.New("token not yet valid")
// ErrTokenMalformed is returned when the token is malformed.
var ErrTokenMalformed = errors.New("token malformed")
// ErrTokenInvalid is returned when the token is invalid.
var ErrTokenInvalid = errors.New("token invalid")
// openapi related
// ErrInvalidOpenAPI is returned when the openapi is invalid.
var ErrInvalidOpenAPI = errors.New("invalid openapi")
// ErrOpenAiApiError is returned when the openai api returns an error.
var ErrOpenAiApiError = errors.New("openai api error")
// http service related
// ErrBadRequest is returned when the request is malformed or contains invalid data.
var ErrBadRequest = errors.New("bad request")
// ErrNotFound is returned when the requested resource is not found.
var ErrNotFound = errors.New("not found")
// ErrInternalServerError is returned when an internal server error occurs.
var ErrInternalServerError = errors.New("internal server error")
// ErrServiceUnavailable is returned when the service is temporarily unavailable.
var ErrServiceUnavailable = errors.New("service unavailable")
// ErrRateLimitExceeded is returned when the client has sent too many requests in a given amount of time.
var ErrRateLimitExceeded = errors.New("rate limit exceeded")
// More errors
// ErrPermissionDenied is returned when the user does not have permission to access the requested resource.
var ErrPermissionDenied = errors.New("permission denied")
// ErrResourceConflict is returned when there is a conflict with the requested resource.
var ErrResourceConflict = errors.New("resource conflict")
// ErrUnprocessableEntity is returned when the server cannot process the request due to client-side errors.
var ErrUnprocessableEntity = errors.New("unprocessable entity")
// ErrGatewayTimeout is returned when the server did not receive a timely response from an external service.
var ErrGatewayTimeout = errors.New("gateway timeout")