Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Fallback error handling is sketchy #7

Open
davidmurdoch opened this issue Aug 23, 2021 · 1 comment
Open

Fallback error handling is sketchy #7

davidmurdoch opened this issue Aug 23, 2021 · 1 comment

Comments

@davidmurdoch
Copy link
Member

See

this.internalWs.on("error", (error) => {
// if max payload size is exceed we want to match uWS error handling.
// It propagates the error with code `1006` and message "Received too big
// message".
if (error.message === "Max payload size exceeded") {
(this.internalWs as any)._closeCode = 1006;
(this.internalWs as any)._closeMessage = "Received too big message";
} else {
throw error;
}
});

What cases are we missing? How can we figure it out to align them better?

@davidmurdoch
Copy link
Member Author

Also of interest is this comment in uWebsockets about why the close code is 1006 instead of 1009.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@davidmurdoch and others