Annotate callback with raises and perform fix for it.

This commit is contained in:
cheatfate 2021-03-25 11:26:16 +02:00
parent 2f01c838c6
commit ebb2c16c0d
No known key found for this signature in database
GPG Key ID: 46ADD633A7201F95
1 changed files with 4 additions and 4 deletions

View File

@ -6,19 +6,19 @@
# Licensed under either of
# Apache License, version 2.0, (LICENSE-APACHEv2)
# MIT license (LICENSE-MIT)
import chronos, chronos/apps
import chronos, chronos/apps/http/[httpcommon, httptable]
import std/[macros, options]
import stew/bitops2
import btrees
import common, segpath
export chronos, apps, options, common
export chronos, options, common, httpcommon, httptable
type
RestApiCallback* = proc(request: HttpRequestRef, pathParams: HttpTable,
queryParams: HttpTable,
body: Option[ContentBody]): Future[RestApiResponse] {.
gcsafe.}
raises: [Defect], gcsafe.}
RestRoute* = object
requestPath*: SegmentedPath
routePath*: SegmentedPath
@ -344,7 +344,7 @@ macro api*(router: RestRouter, meth: static[HttpMethod],
res.add quote do:
proc `doMain`(`requestParam`: HttpRequestRef, `pathParams`: HttpTable,
`queryParams`: HttpTable, `bodyParam`: Option[ContentBody]
): Future[RestApiResponse] {.async.} =
): Future[RestApiResponse] {.raises: [Defect], async.} =
`pathDecoder`
`optDecoder`