taoensso / sente

Realtime web comms library for Clojure/Script
https://www.taoensso.com/sente
Eclipse Public License 1.0
1.74k stars 193 forks source link

improved error handling for custom transit handlers #340

Closed yogthos closed 1 year ago

yogthos commented 5 years ago

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 commented 1 year ago

@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 https://github.com/ptaoussanis/sente/issues/346, should already be fixed on local dev

yogthos commented 1 year ago

Thanks for the heads up!