Simplify error parser

This commit is contained in:
Zed
2020-06-01 21:53:21 +02:00
parent 2642e5efe4
commit 2fa76db099
4 changed files with 8 additions and 7 deletions

View File

@@ -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: