Skip to content

Commit

Permalink
o
Browse files Browse the repository at this point in the history
  • Loading branch information
bung87 committed May 28, 2023
1 parent 410054f commit 7dfdb07
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/scorper/http/streamserver.nim
Original file line number Diff line number Diff line change
Expand Up @@ -653,10 +653,9 @@ proc defaultErrorHandle(req: ImpRequest, err: ref Exception | HttpError; headers
headers.ContentType "text/plain"
await req.respError(Http400, err.msg, headers)

template tryHandle(req: ImpRequest, body: untyped, keep: var bool) =
mixin defaultErrorHandle
template tryHandle(req: ImpRequest, fut: untyped, keep: var bool) =
try:
await wait(body, TimeOut.seconds)
await chronos.wait(fut, TimeOut.seconds)
except AsyncTimeoutError:
if not req.responded:
let err = newHttpError(408.HttpCode)
Expand Down

0 comments on commit 7dfdb07

Please sign in to comment.