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

Add support for "parse" lifecycle event for websockets. #33

Merged
merged 1 commit into from
Apr 21, 2023

Conversation

ntzrbtr
Copy link
Contributor

@ntzrbtr ntzrbtr commented Apr 9, 2023

One of the clients in my project tries to open a websocket connection with the content type set to "application/json", but without sending a request body. This results in an error in the compiled handler (line 71 in compose.ts), so in order to fix this, I would need support for the "parse" lifecycle event also for websockets.

The other solution would be to do a more fine-grained handling of errors in the generated code in compose.ts, but for now I like the simplicity of the approach with only one try-catch block for everything.

ntzrbtr added a commit to ntzrbtr/documentation that referenced this pull request Apr 9, 2023
This is documentation for elysiajs/elysia#33 and can be merged after that.
@SaltyAom
Copy link
Member

Sorry for the slow response, I had a vacation the last week and didn't have a chance to check the mail.

Back to the topic, right, sounds like the problem with generated code, we will try to improve it in the later version to be more fine-grained in the future, but this is good enough for now.

@SaltyAom SaltyAom merged commit d160448 into elysiajs:main Apr 21, 2023
@SaltyAom
Copy link
Member

Should be available in 0.4.9

Quals6 added a commit to Quals6/vitepress that referenced this pull request Aug 5, 2024
This is documentation for elysiajs/elysia#33 and can be merged after that.
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