mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
Simplify error parser
This commit is contained in:
parent
2642e5efe4
commit
2fa76db099
4 changed files with 8 additions and 7 deletions
|
|
@ -48,7 +48,7 @@ proc fetch*(url: Uri; retried=false; oldApi=false): Future[JsonNode] {.async.} =
|
|||
|
||||
result = parseJson(body)
|
||||
|
||||
if result{"errors"} != nil and result{"errors"}[0]{"code"}.getInt == 200:
|
||||
if result{"errors"} != nil and result.getError == forbidden:
|
||||
keepToken = false
|
||||
echo "bad token"
|
||||
except:
|
||||
|
|
|
|||
Loading…
Reference in a new issue