Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce compiler warnings #156

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading