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

improved error handling for custom transit handlers #340

Closed
yogthos opened this issue Mar 27, 2019 · 2 comments
Closed

improved error handling for custom transit handlers #340

yogthos opened this issue Mar 27, 2019 · 2 comments

Comments

@yogthos
Copy link

yogthos commented Mar 27, 2019

Currently, when a custom transit handler fails the error is not propagated to the user, and instead you get "Invalid event" error which is a bit of a red herring, e.g:

(sente-transit/get-transit-packer
               :json
               {}
               {:handlers
                {"some-tag"
                 (fn [args]
                   (throw (js/Error. "failed")))}})

It would be better to show the user an error indicating that transit handler failed to parse the given value.

@ptaoussanis
Copy link
Member

ptaoussanis commented Feb 27, 2023

@yogthos Hi Dimitri, apologies for the huge delay responding to this!
Thanks for the report, will be addressed in forthcoming v1.18 release 👍

Note to self: appears to be the same issue as #346, should already be fixed on local dev

@yogthos
Copy link
Author

yogthos commented Feb 27, 2023

Thanks for the heads up!

ptaoussanis added a commit that referenced this issue Mar 7, 2023
This was unfortunately preventing clients from manually handling malformed packages,
and leading to confusing errors (e.g. #340).
ptaoussanis added a commit that referenced this issue Mar 7, 2023
This was unfortunately preventing clients from manually handling malformed packages,
and leading to confusing errors (e.g. #340).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants