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

Fix onerror handler #727

Merged
merged 1 commit into from
Apr 25, 2024
Merged

Fix onerror handler #727

merged 1 commit into from
Apr 25, 2024

Conversation

eyr1n
Copy link
Contributor

@eyr1n eyr1n commented Apr 12, 2024

Changelog

EventEmitter always emits values of Error types on "error", not undefined.

Description

According to the documentation of ws module for Node.js, onerror handler emits Error types.
However, WebSocket in the browser does not emits event.error. This behavior is incorrect as per the code below.

error: (error: Error) => void;

I fixed to always emits values of Error types on "error".

@CLAassistant
Copy link

CLAassistant commented Apr 12, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@achim-k achim-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine. AFAIU, in the browser the error event does not contain any information so just emitting a new Error seems OK

@achim-k achim-k merged commit 4687078 into foxglove:main Apr 25, 2024
12 checks passed
@eyr1n eyr1n deleted the fix/onerror branch April 26, 2024 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants