Cast exception to message on send error, closes #2679 (#2680)

This commit is contained in:
José Valim 2024-06-25 20:15:38 +02:00 committed by GitHub
parent 3f229269b7
commit 4f44d4c760
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -185,11 +185,11 @@ defmodule Livebook.Teams.WebSocket do
{:ok, conn} <- Mint.WebSocket.stream_request_body(conn, ref, data) do
{:ok, conn, websocket}
else
{:error, %Mint.HTTP1{} = conn, reason} ->
{:error, conn, websocket, reason}
{:error, %Mint.HTTP1{} = conn, exception} when is_exception(exception) ->
{:error, conn, websocket, Exception.message(exception)}
{:error, websocket, reason} ->
{:error, conn, websocket, reason}
{:error, websocket, exception} when is_exception(exception) ->
{:error, conn, websocket, Exception.message(exception)}
end
end
end