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"):
|
if result.startsWith("{\"errors"):
|
||||||
let errors = result.fromJson(Errors)
|
let errors = result.fromJson(Errors)
|
||||||
if errors in {expiredToken, badToken}:
|
if errors in {expiredToken, badToken, authorizationError}:
|
||||||
echo "fetch error: ", errors
|
echo "fetch error: ", errors
|
||||||
invalidate(account)
|
invalidate(account)
|
||||||
raise rateLimitError()
|
raise rateLimitError()
|
||||||
|
@ -159,7 +159,7 @@ proc fetch*(url: Uri; api: Api; additional_headers: HttpHeaders = newHttpHeaders
|
||||||
result = newJNull()
|
result = newJNull()
|
||||||
|
|
||||||
let error = result.getError
|
let error = result.getError
|
||||||
if error in {expiredToken, badToken}:
|
if error in {expiredToken, badToken, authorizationError}:
|
||||||
echo "fetchBody error: ", error
|
echo "fetchBody error: ", error
|
||||||
invalidate(account)
|
invalidate(account)
|
||||||
raise rateLimitError()
|
raise rateLimitError()
|
||||||
|
|
|
@ -62,9 +62,10 @@ type
|
||||||
tweetNotAuthorized = 179
|
tweetNotAuthorized = 179
|
||||||
forbidden = 200
|
forbidden = 200
|
||||||
badToken = 239
|
badToken = 239
|
||||||
|
authorizationError = 326
|
||||||
noCsrf = 353
|
noCsrf = 353
|
||||||
tweetUnavailable = 421
|
tweetUnavailable = 421
|
||||||
tweetCensored = 422
|
tweetCensored = 426
|
||||||
|
|
||||||
VerifiedType* = enum
|
VerifiedType* = enum
|
||||||
none = "None"
|
none = "None"
|
||||||
|
|
Loading…
Reference in a new issue