1
0
mirror of https://github.com/zedeus/nitter.git synced 2026-01-25 21:02:49 -05:00

Catch SSL shutdown errors when closing clients

This commit is contained in:
Zed
2020-01-01 17:24:24 +01:00
parent b09798f2cf
commit ee43d8cfb1
3 changed files with 11 additions and 3 deletions

View File

@@ -26,7 +26,9 @@ proc genHeaders*(agent: string; referer: Uri; lang=true;
template newClient*() {.dirty.} =
var client = newAsyncHttpClient()
defer: client.close()
defer:
try: client.close()
except: discard
client.headers = headers
proc fetchHtml*(url: Uri; headers: HttpHeaders; jsonKey = ""): Future[XmlNode] {.async.} =