Skip to content

Commit

Permalink
Reduce compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jangko committed Jan 25, 2024
1 parent a7f9258 commit fc3c855
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/server.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion tests/extensions/testextflow.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions tests/helpers.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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/[
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion websock/http/server.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fc3c855

Please sign in to comment.