Don't catch-all in asynchttpserver. It hides bugs.
This commit is contained in:
parent
2a7cfe4043
commit
a372363190
1 changed files with 1 additions and 4 deletions
|
|
@ -275,10 +275,7 @@ proc processClient(server: AsyncHttpServer, client: AsyncSocket, address: string
|
||||||
lineFut.mget() = newStringOfCap(80)
|
lineFut.mget() = newStringOfCap(80)
|
||||||
|
|
||||||
while not client.isClosed:
|
while not client.isClosed:
|
||||||
try:
|
await processRequest(server, request, client, address, lineFut, callback)
|
||||||
await processRequest(server, request, client, address, lineFut, callback)
|
|
||||||
except:
|
|
||||||
asyncCheck request.mget().respondError(Http500)
|
|
||||||
|
|
||||||
proc serve*(server: AsyncHttpServer, port: Port,
|
proc serve*(server: AsyncHttpServer, port: Port,
|
||||||
callback: proc (request: Request): Future[void] {.closure,gcsafe.},
|
callback: proc (request: Request): Future[void] {.closure,gcsafe.},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue