Skip to content

Commit 3418ae2

Browse files
committed
Improve error message handling in WebSockets.
Ensure the exception message is passed to the error. If the WebSocket was not properly created we also re-raise the exception for it to be caught by the server and be recorded into the error log. Part of T416-030.
1 parent a4f0692 commit 3418ae2

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/core/aws-server-http_utils.adb

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1712,14 +1712,19 @@ package body AWS.Server.HTTP_Utils is
17121712
end if;
17131713

17141714
exception
1715-
when others =>
1716-
Send_WebSocket_Handshake_Error (Messages.S403);
1715+
when E : others =>
1716+
Send_WebSocket_Handshake_Error
1717+
(Messages.S403,
1718+
Exception_Message (E));
17171719
WS.Shutdown;
17181720
end;
17191721

17201722
exception
1721-
when others =>
1722-
Send_WebSocket_Handshake_Error (Messages.S403);
1723+
when E : others =>
1724+
Send_WebSocket_Handshake_Error
1725+
(Messages.S403,
1726+
Exception_Message (E));
1727+
raise;
17231728
end;
17241729

17251730
else

0 commit comments

Comments
 (0)