From 605171a20dc9ce418458feafc8a93cbad5042ac3 Mon Sep 17 00:00:00 2001 From: Ludovic Chenut Date: Fri, 29 Mar 2024 12:17:55 +0100 Subject: [PATCH] remove useless `except` & improve error message --- webrtc/udp_connection.nim | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/webrtc/udp_connection.nim b/webrtc/udp_connection.nim index d9a86b7..b3c5685 100644 --- a/webrtc/udp_connection.nim +++ b/webrtc/udp_connection.nim @@ -75,9 +75,8 @@ proc write*( try: await self.udp.sendTo(raddr, msg) except TransportError as exc: - raise newException(WebRtcUdpError, exc.msg, exc) - except CancelledError as exc: - raise exc + raise newException(WebRtcUdpError, + "Error when sending data on a DatagramTransport: " & exc.msg , exc) proc read*(self: UdpConn): Future[UdpPacketInfo] {.async: (raises: [CancelledError]).} = ## Read the next received Udp message