parent
372b58d1fe
commit
af1d873de0
2 changed files with 4 additions and 3 deletions
|
@ -109,7 +109,7 @@ template fetchImpl(result, additional_headers, fetchBody) {.dirty.} =
|
|||
|
||||
if result.startsWith("{\"errors"):
|
||||
let errors = result.fromJson(Errors)
|
||||
if errors in {expiredToken, badToken}:
|
||||
if errors in {expiredToken, badToken, authorizationError}:
|
||||
echo "fetch error: ", errors
|
||||
invalidate(account)
|
||||
raise rateLimitError()
|
||||
|
@ -159,7 +159,7 @@ proc fetch*(url: Uri; api: Api; additional_headers: HttpHeaders = newHttpHeaders
|
|||
result = newJNull()
|
||||
|
||||
let error = result.getError
|
||||
if error in {expiredToken, badToken}:
|
||||
if error in {expiredToken, badToken, authorizationError}:
|
||||
echo "fetchBody error: ", error
|
||||
invalidate(account)
|
||||
raise rateLimitError()
|
||||
|
|
|
@ -62,9 +62,10 @@ type
|
|||
tweetNotAuthorized = 179
|
||||
forbidden = 200
|
||||
badToken = 239
|
||||
authorizationError = 326
|
||||
noCsrf = 353
|
||||
tweetUnavailable = 421
|
||||
tweetCensored = 422
|
||||
tweetCensored = 426
|
||||
|
||||
VerifiedType* = enum
|
||||
none = "None"
|
||||
|
|
Loading…
Reference in a new issue