mirror of
https://github.com/codex-storage/nim-websock.git
synced 2025-01-22 08:29:16 +00:00
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)
|
HttpServer.create(initTAddress("127.0.0.1:8888"), flags = socketFlags)
|
||||||
|
|
||||||
when defined accepts:
|
when defined accepts:
|
||||||
proc accepts() {.async, raises: [Defect].} =
|
proc accepts() {.async, raises: [].} =
|
||||||
while true:
|
while true:
|
||||||
try:
|
try:
|
||||||
let req = await server.accept()
|
let req = await server.accept()
|
||||||
|
@ -14,7 +14,7 @@ import pkg/asynctest/unittest2
|
|||||||
import ../../ws/ws
|
import ../../ws/ws
|
||||||
|
|
||||||
type
|
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
|
HelperExtension = ref object of Ext
|
||||||
handler*: ExtHandler
|
handler*: ExtHandler
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
## This file may not be copied, modified, or distributed except according to
|
## This file may not be copied, modified, or distributed except according to
|
||||||
## those terms.
|
## those terms.
|
||||||
|
|
||||||
{.push raises: [Defect].}
|
{.push raises: [].}
|
||||||
|
|
||||||
import std/[strutils, random]
|
import std/[strutils, random]
|
||||||
import pkg/[
|
import pkg/[
|
||||||
@ -64,12 +64,14 @@ proc createServer*(
|
|||||||
flags = flags)
|
flags = flags)
|
||||||
|
|
||||||
when defined accepts:
|
when defined accepts:
|
||||||
proc accepts() {.async, raises: [].} =
|
proc accepts() {.async: (raises: []).} =
|
||||||
try:
|
try:
|
||||||
let req = await server.accept()
|
let req = await server.accept()
|
||||||
await req.handler()
|
await req.handler()
|
||||||
except TransportOsError as exc:
|
except TransportOsError as exc:
|
||||||
error "Transport error", exc = exc.msg
|
error "Transport error", exc = exc.msg
|
||||||
|
except CatchableError as exc:
|
||||||
|
error "Unknown error", exc = exc.msg
|
||||||
|
|
||||||
asyncSpawn accepts()
|
asyncSpawn accepts()
|
||||||
else:
|
else:
|
||||||
|
@ -25,7 +25,7 @@ logScope:
|
|||||||
|
|
||||||
type
|
type
|
||||||
HttpAsyncCallback* = proc (request: HttpRequest):
|
HttpAsyncCallback* = proc (request: HttpRequest):
|
||||||
Future[void] {.closure, gcsafe, raises: [Defect].}
|
Future[void] {.closure, gcsafe, raises: [].}
|
||||||
|
|
||||||
HttpServer* = ref object of StreamServer
|
HttpServer* = ref object of StreamServer
|
||||||
handler*: HttpAsyncCallback
|
handler*: HttpAsyncCallback
|
||||||
|
Loading…
x
Reference in New Issue
Block a user