mirror of
https://github.com/zedeus/nitter
synced 2026-09-06 07:09:31 +00:00
Catch SSL shutdown errors when closing clients
This commit is contained in:
parent
b09798f2cf
commit
ee43d8cfb1
3 changed files with 11 additions and 3 deletions
|
|
@ -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.} =
|
||||
|
|
|
|||
Loading…
Reference in a new issue