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

Add logs to Teams connection flow #2914

Merged
merged 6 commits into from
Jan 23, 2025
Merged
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
5 changes: 5 additions & 0 deletions lib/livebook/teams/connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,20 @@ defmodule Livebook.Teams.Connection do
{:ok, conn, websocket, ref} ->
send(data.listener, :connected)
send(self(), {:loop_ping, ref})
Logger.info("Teams WebSocket connection - established")

{:keep_state, %{data | http_conn: conn, ref: ref, websocket: websocket}}

{:transport_error, reason} ->
send(data.listener, {:connection_error, reason})
Logger.warning("Teams WebSocket connection - transport error: #{inspect(reason)}")

{:keep_state_and_data, {{:timeout, :backoff}, @backoff, nil}}

{:server_error, error} ->
reason = LivebookProto.Error.decode(error).details
send(data.listener, {:server_error, reason})
Logger.warning("Teams WebSocket connection - server error : #{inspect(reason)}")

{:keep_state, data}
end
Expand All @@ -70,6 +74,7 @@ defmodule Livebook.Teams.Connection do
{:keep_state, %{data | http_conn: conn, websocket: websocket}}

{:error, conn, websocket, _reason} ->
Logger.warning("Teams WebSocket connection - ping error")
{:keep_state, %{data | http_conn: conn, websocket: websocket}}
end
end
Expand Down
Loading