Skip to content

Commit d8a03aa

Browse files
authored
Add assert into handleRequest
This is to add a bit of a nicer error if we mess up the logic in that proc.
1 parent a65dbf7 commit d8a03aa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

jester.nim

+2
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@ proc handleRequest(jes: Jester, httpReq: NativeRequest): Future[void] =
400400
let exc = getCurrentException()
401401
let respDataFut = dispatchError(jes, req, initRouteError(exc))
402402
return handleRequestSlow(jes, req, respDataFut, true)
403+
404+
assert(not result.isNil, "Expected handleRequest to return a valid future.")
403405

404406
proc newSettings*(
405407
port = Port(5000), staticDir = getCurrentDir() / "public",

0 commit comments

Comments
 (0)