Reduce compiler warnings
This commit is contained in:
parent
a7f9258b55
commit
fc3c85581c
|
@ -58,7 +58,7 @@ when isMainModule:
|
|||
HttpServer.create(initTAddress("127.0.0.1:8888"), flags = socketFlags)
|
||||
|
||||
when defined accepts:
|
||||
proc accepts() {.async, raises: [Defect].} =
|
||||
proc accepts() {.async, raises: [].} =
|
||||
while true:
|
||||
try:
|
||||
let req = await server.accept()
|
||||
|
|
|
@ -14,7 +14,7 @@ import pkg/asynctest/unittest2
|
|||
import ../../ws/ws
|
||||
|
||||
type
|
||||
ExtHandler = proc(ext: Ext, frame: Frame): Future[Frame] {.raises: [Defect].}
|
||||
ExtHandler = proc(ext: Ext, frame: Frame): Future[Frame] {.raises: [].}
|
||||
|
||||
HelperExtension = ref object of Ext
|
||||
handler*: ExtHandler
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
## This file may not be copied, modified, or distributed except according to
|
||||
## those terms.
|
||||
|
||||
{.push raises: [Defect].}
|
||||
{.push raises: [].}
|
||||
|
||||
import std/[strutils, random]
|
||||
import pkg/[
|
||||
|
@ -64,12 +64,14 @@ proc createServer*(
|
|||
flags = flags)
|
||||
|
||||
when defined accepts:
|
||||
proc accepts() {.async, raises: [].} =
|
||||
proc accepts() {.async: (raises: []).} =
|
||||
try:
|
||||
let req = await server.accept()
|
||||
await req.handler()
|
||||
except TransportOsError as exc:
|
||||
error "Transport error", exc = exc.msg
|
||||
except CatchableError as exc:
|
||||
error "Unknown error", exc = exc.msg
|
||||
|
||||
asyncSpawn accepts()
|
||||
else:
|
||||
|
|
|
@ -25,7 +25,7 @@ logScope:
|
|||
|
||||
type
|
||||
HttpAsyncCallback* = proc (request: HttpRequest):
|
||||
Future[void] {.closure, gcsafe, raises: [Defect].}
|
||||
Future[void] {.closure, gcsafe, raises: [].}
|
||||
|
||||
HttpServer* = ref object of StreamServer
|
||||
handler*: HttpAsyncCallback
|
||||
|
|
Loading…
Reference in New Issue