Don't catch-all in asynchttpserver. It hides bugs.

This commit is contained in:
Dominik Picheta
2017-11-26 16:40:24 +00:00
parent 2a7cfe4043
commit a372363190

View File

@@ -275,10 +275,7 @@ proc processClient(server: AsyncHttpServer, client: AsyncSocket, address: string
lineFut.mget() = newStringOfCap(80)
while not client.isClosed:
try:
await processRequest(server, request, client, address, lineFut, callback)
except:
asyncCheck request.mget().respondError(Http500)
await processRequest(server, request, client, address, lineFut, callback)
proc serve*(server: AsyncHttpServer, port: Port,
callback: proc (request: Request): Future[void] {.closure,gcsafe.},