fixes bareExcept warnings; catch specific exceptions (#21119)

* fixes bareExcept warnings; catch specific exceptions

* Update lib/pure/coro.nim

(cherry picked from commit 9207d77848)
This commit is contained in:
ringabout
2023-08-13 06:02:36 +08:00
committed by narimiran
parent 09f7be13b6
commit dc59e67a12

View File

@@ -375,7 +375,7 @@ const
proc listen*(server: AsyncHttpServer; port: Port; address = ""; domain = AF_INET) =
## Listen to the given port and address.
when declared(maxDescriptors):
server.maxFDs = try: maxDescriptors() except: nimMaxDescriptorsFallback
server.maxFDs = try: maxDescriptors() except OSError: nimMaxDescriptorsFallback
else:
server.maxFDs = nimMaxDescriptorsFallback
server.socket = newAsyncSocket(domain)