Handle decompression errors

This commit is contained in:
Zed
2021-12-28 05:02:28 +01:00
parent 4b356118a6
commit 6bcbe0ea9f
3 changed files with 12 additions and 3 deletions

View File

@@ -64,6 +64,9 @@ proc fetch*(url: Uri; oldApi=false): Future[JsonNode] {.async.} =
echo "fetch error: ", result.getError
release(token, true)
raise rateLimitError()
except ZippyError as e:
echo "decompression error: ", e.msg, ", url: ", url
raise newException(InternalError, "decompression failed: " & $url)
except Exception as e:
echo "error: ", e.msg, ", token: ", token[], ", url: ", url
if "length" notin e.msg and "descriptor" notin e.msg: