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

Wrap inflation errors #500

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mastermatt
Copy link
Contributor

Feature Request in PR form.

pako has a tendency to throw obscure error strings e.g. "too many length or distance symbols", which can make gracefully handling bad input difficult when an error is thrown from parseLoginRequest.
This wraps the inflation step to allow throwing a dedicated error with a static message for inflation issues, while still making the original error available.

src/utility.ts Outdated Show resolved Hide resolved
src/flow.ts Outdated Show resolved Hide resolved
`pako` has a tendency to throw obscure error strings e.g. "too many length or distance symbols", which can make gracefully handling bad input difficult when an error is thrown from `parseLoginRequest`.
This wraps the inflation step to allow throwing a dedicated error with a static message for inflation issues, while still making the original error available.
Copy link

@KuSh KuSh left a comment

Choose a reason for hiding this comment

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

Perfect 👌

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.

None yet

2 participants