Skip to content

Use correct ws on_error type#65

Merged
aecsocket merged 1 commit intoaecsocket:mainfrom
liamaharon:ws-error-handling
Sep 25, 2025
Merged

Use correct ws on_error type#65
aecsocket merged 1 commit intoaecsocket:mainfrom
liamaharon:ws-error-handling

Conversation

@liamaharon
Copy link
Copy Markdown
Contributor

ws on_error panics at the moment because it expects an ErrorEvent with a message but actually receives a generic Event with no message.

Screenshot 2025-09-24 at 15 32 32

https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/error_event#event_type

@aecsocket
Copy link
Copy Markdown
Owner

I missed that the event type was an Event not an ErrorEvent there! Since we get a generic Event and have no better message, let's use event.to_string() instead of a hardcoded error message. It probably won't be much more useful, but at least gives a bit of insight into the error.

@liamaharon liamaharon changed the title Fix ws on_error Use correct ws on_error type Sep 24, 2025
@liamaharon
Copy link
Copy Markdown
Contributor Author

Sure, I've changed it to return .to_string() instead.

@aecsocket aecsocket merged commit 99424a5 into aecsocket:main Sep 25, 2025
15 checks passed
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.

2 participants