diff --git a/lib/bandit/http2/stream.ex b/lib/bandit/http2/stream.ex index 220341c8..c7194bc9 100644 --- a/lib/bandit/http2/stream.ex +++ b/lib/bandit/http2/stream.ex @@ -443,7 +443,11 @@ defmodule Bandit.HTTP2.Stream do |> do_recv_send_window_update(delta) |> send_data(rest, end_stream) after - stream.read_timeout -> raise "Timeout waiting for space in the send_window" + stream.read_timeout -> + stream_error!( + "Timeout waiting for space in the send_window", + Bandit.HTTP2.Errors.flow_control_error() + ) end end end