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:
@@ -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.} =
|
||||
|
||||
Reference in New Issue
Block a user