commit | author | age
|
655e66
|
1 |
/* |
H |
2 |
* Copyright (C) 2017 Twitter, Inc. |
|
3 |
* |
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
5 |
* you may not use this file except in compliance with the License. |
|
6 |
* You may obtain a copy of the License at |
|
7 |
* |
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0 |
|
9 |
* |
|
10 |
* Unless required by applicable law or agreed to in writing, software |
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS, |
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
13 |
* See the License for the specific language governing permissions and |
|
14 |
* limitations under the License. |
|
15 |
* |
|
16 |
*/ |
a0a843
|
17 |
|
H |
18 |
#import <Foundation/Foundation.h> |
|
19 |
|
|
20 |
NS_ASSUME_NONNULL_BEGIN |
|
21 |
|
|
22 |
/** |
|
23 |
* The NSError domain of errors surfaced by the Twitter API. |
|
24 |
*/ |
655e66
|
25 |
FOUNDATION_EXTERN NSString *const TWTRAPIErrorDomain; |
a0a843
|
26 |
|
H |
27 |
/** |
|
28 |
* Error codes surfaced by the Twitter API. |
|
29 |
* @see https://dev.twitter.com/docs/error-codes-responses |
|
30 |
*/ |
|
31 |
typedef NS_ENUM(NSUInteger, TWTRAPIErrorCode) { |
|
32 |
/** |
|
33 |
* Your call could not be completed as dialed. |
|
34 |
*/ |
|
35 |
TWTRAPIErrorCodeCouldNotAuthenticate = 32, |
|
36 |
|
|
37 |
/** |
|
38 |
* Corresponds with an HTTP 404 - the specified resource was not found. |
|
39 |
*/ |
|
40 |
TWTRAPIErrorCodePageNotExist = 34, |
|
41 |
|
|
42 |
/** |
|
43 |
* Not authorized to use this endpoint. |
|
44 |
*/ |
|
45 |
TWTRAPIErrorCodeNotAuthorizedForEndpoint = 37, |
|
46 |
|
|
47 |
/** |
|
48 |
* Generic API error code for invalid parameter |
|
49 |
*/ |
|
50 |
TWTRAPIErrorCodeInvalidParameter = 44, |
|
51 |
|
|
52 |
/** |
|
53 |
* Corresponds with an HTTP 403 — the access token being used belongs to a suspended user and they can't complete the action you're trying to take |
|
54 |
*/ |
|
55 |
TWTRAPIErrorCodeAccountSuspended = 64, |
|
56 |
|
|
57 |
/** |
|
58 |
* Corresponds to a HTTP request to a retired v1-era URL. |
|
59 |
*/ |
|
60 |
TWTRAPIErrorCodeAPIVersionRetired = 68, |
|
61 |
|
|
62 |
/** |
|
63 |
* The request limit for this resource has been reached for the current rate limit window. |
|
64 |
*/ |
|
65 |
TWTRAPIErrorCodeRateLimitExceeded = 88, |
|
66 |
|
|
67 |
/** |
|
68 |
* The access token used in the request is incorrect or has expired. Used in API v1.1. |
|
69 |
*/ |
|
70 |
TWTRAPIErrorCodeInvalidOrExpiredToken = 89, |
|
71 |
|
|
72 |
/** |
|
73 |
* Only SSL connections are allowed in the API, you should update your request to a secure connection. See [how to connect using SSL](https://dev.twitter.com/docs/security/using-ssl). |
|
74 |
*/ |
|
75 |
TWTRAPIErrorCodeSSLInvalid = 92, |
|
76 |
|
|
77 |
/** |
|
78 |
* Corresponds with an HTTP 503 - Twitter is temporarily over capacity. |
|
79 |
*/ |
|
80 |
TWTRAPIErrorCodeOverCapacity = 130, |
|
81 |
|
|
82 |
/** |
|
83 |
* Corresponds with an HTTP 500 - An unknown internal error occurred. |
|
84 |
*/ |
|
85 |
TWTRAPIErrorCodeInternalError = 131, |
|
86 |
|
|
87 |
/** |
|
88 |
* Corresponds with a HTTP 401 - it means that your oauth_timestamp is either ahead or behind our acceptable range. |
|
89 |
*/ |
|
90 |
TWTRAPIErrorCodeCouldNotAuthenticateTimestampOutOfRange = 135, |
|
91 |
|
|
92 |
/** |
|
93 |
* You have already favorited this status. |
|
94 |
*/ |
|
95 |
TWTRAPIErrorCodeAlreadyFavorited = 139, |
|
96 |
|
|
97 |
/** |
|
98 |
* Corresponds with HTTP 403 — returned when a user cannot follow another user due to some kind of limit. |
|
99 |
*/ |
|
100 |
TWTRAPIErrorCodeCannotFollowOverLimit = 161, |
|
101 |
|
|
102 |
/** |
|
103 |
* Corresponds with HTTP 403 — returned when a Tweet cannot be viewed by the authenticating user, usually due to the Tweet's author having protected their Tweets. |
|
104 |
*/ |
|
105 |
TWTRAPIErrorCodeNotAuthorizedToSeeStatus = 179, |
|
106 |
|
|
107 |
/** |
|
108 |
* Corresponds with HTTP 403 — returned when a Tweet cannot be posted due to the user having no allowance remaining to post. Despite the text in the error message indicating that this error is only returned when a daily limit is reached, this error will be returned whenever a posting limitation has been reached. Posting allowances have roaming windows of time of unspecified duration. |
|
109 |
*/ |
|
110 |
TWTRAPIErrorCodeOverDailyStatusUpdateLimit = 185, |
|
111 |
|
|
112 |
/** |
|
113 |
* The status text has been Tweeted already by the authenticated account. |
|
114 |
*/ |
|
115 |
TWTRAPIErrorCodeStatusIsDuplicate = 187, |
|
116 |
|
|
117 |
/** |
|
118 |
* Typically sent with 1.1 responses with HTTP code 400. The method requires authentication but it was not presented or was wholly invalid. |
|
119 |
*/ |
|
120 |
TWTRAPIErrorCodeBadAuthenticationData = 215, |
|
121 |
|
|
122 |
/** |
|
123 |
* We constantly monitor and adjust our filters to block spam and malicious activity on the Twitter platform. These systems are tuned in real-time. If you get this response our systems have flagged the Tweet or DM as possibly fitting this profile. If you feel that the Tweet or DM you attempted to create was flagged in error, please report the details around that to us by filing a ticket at https://support.twitter.com/forms/platform |
|
124 |
*/ |
|
125 |
TWTRAPIErrorCodeRequestIsAutomated = 226, |
|
126 |
|
|
127 |
/** |
|
128 |
* Returned as a challenge in xAuth when the user has login verification enabled on their account and needs to be directed to twitter.com to [generate a temporary password](https://twitter.com/settings/applications). |
|
129 |
*/ |
|
130 |
TWTRAPIErrorCodeUserMustVerifyLogin = 231, |
|
131 |
|
|
132 |
/** |
|
133 |
* Returned from server in digits sign-in flow if user provides wrong confirmation code |
|
134 |
*/ |
|
135 |
TWTRAPIErrorCodeChallengeCodeInvalid = 236, |
|
136 |
|
|
137 |
/** |
655e66
|
138 |
* "Bad guest token." The token has probably expired. Try calling `-[TWTRTwitter logInGuestWithCompletion:]` again later. |
a0a843
|
139 |
*/ |
H |
140 |
TWTRAPIErrorCodeBadGuestToken = 239, |
|
141 |
|
|
142 |
/** |
|
143 |
* Rate limiting case for /1/sdk/login |
|
144 |
*/ |
|
145 |
TWTRAPIErrorCodeLoginRateExceeded = 245, |
|
146 |
|
|
147 |
/** |
|
148 |
* Corresponds to a HTTP request to a retired URL. |
|
149 |
*/ |
|
150 |
TWTRAPIErrorCodeEndpointRetired = 251, |
|
151 |
|
|
152 |
/** |
|
153 |
* Corresponds with HTTP 403 — returned when the application is restricted from POST, PUT, or DELETE actions. See [How to appeal application suspension and other disciplinary actions](https://support.twitter.com/articles/72585). |
|
154 |
*/ |
|
155 |
TWTRAPIErrorCodeApplicationCannotPerformWriteAction = 261, |
|
156 |
|
|
157 |
/** |
|
158 |
* Corresponds with HTTP 403. The authenticated user account cannot mute itself. |
|
159 |
*/ |
|
160 |
TWTRAPIErrorCodeCannotMuteSelf = 271, |
|
161 |
|
|
162 |
/** |
|
163 |
* Corresponds with HTTP 403. The authenticated user account is not muting the account a call is attempting to unmute. |
|
164 |
*/ |
|
165 |
TWTRAPIErrorCodeCannotMuteSpecifiedUser = 272, |
|
166 |
|
|
167 |
/** |
|
168 |
* Rate limiting case for /1.1/device/register.json endpint |
|
169 |
*/ |
|
170 |
TWTRAPIErrorCodeDeviceRegisterRateExceeded = 299, |
|
171 |
|
|
172 |
/** |
|
173 |
* Phone's carrier not suppported and we can not deliver the sms/make the voice call |
|
174 |
*/ |
|
175 |
TWTRAPIErrorCodeDeviceCarrierNotSupported = 286, |
|
176 |
|
|
177 |
/** |
|
178 |
* You have already retweeted this tweet. |
|
179 |
*/ |
|
180 |
TWTRAPIErrorCodeAlreadyRetweeted = 327, |
|
181 |
|
|
182 |
/** |
|
183 |
* Returned in API v1.1 when a request cannot be served due to the application's rate limit having been exhausted for the resource. See [Rate Limiting in API v1.1](https://dev.twitter.com/docs/rate-limiting/1.1). |
|
184 |
*/ |
|
185 |
TWTRAPIErrorCodeTooManyRequests = 429 |
|
186 |
}; |
|
187 |
|
|
188 |
NS_ASSUME_NONNULL_END |