Skip to content

fix: report frames that fail to decode through handle_error/2 - #103

Merged
nmbrone merged 1 commit into
mainfrom
fix/decode-frame-errors
Sep 30, 2026
Merged

nmbrone merged 1 commit into
mainfrom
fix/decode-frame-errors

Conversation

@nmbrone

@nmbrone nmbrone commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Mint.WebSocket.decode/2 returns a frame that fails to decode as {:error, reason} inside the frame list. That element reached handle_frame/2 as if it were a frame, and Minch.connect/3 receivers got it as {:frame, ref, {:error, reason}}.

It now goes to handle_error/2 as {:decode_frame, reason}, the same shape as a payload that fails to decode as a whole. The other frames in the batch are still delivered.

`Mint.WebSocket.decode/2` returns a frame that fails to decode as `{:error, reason}` inside the frame list. That element reached `handle_frame/2` as if it were a frame, and `Minch.connect/3` receivers got it as `{:frame, ref, {:error, reason}}`.

It now goes to `handle_error/2` as `{:decode_frame, reason}`, the same shape as a payload that fails to decode as a whole. The other frames in the batch are still delivered.
@nmbrone
nmbrone merged commit cb05782 into main Sep 30, 2026
4 checks passed
@nmbrone
nmbrone deleted the fix/decode-frame-errors branch September 30, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant