Closed kovasap closed 1 year ago
Hi Kovas!
I'm getting the following error in my browser console when making this call
It looks like your event-id keyword needs to be namespaced, so something like :my/testing
. The README (see <ev-id>
form) and reference example show examples that should work.
Here is the code that validates events.
I'd encourage you to try start with the reference example and confirm that you can get that working as expected. Then you can adapt it as needed, or use it as a point of comparison.
Is there any way this error message could be made more informative?
The error thrown is an ex-info
type which should include detailed information about the cause of the problem.
How are you logging errors? It's possible that your logging tool/config is set to not include this information.
The reference example shows how to use Timbre, which should include this info by default. (I don't recall for sure, but you might need to check that you're using a recent version of Timbre (latest is [com.taoensso/timbre "6.0.4"]
).
The current Sente reference example dependencies are a little out of date, am planning to update then when I next do some batched work on Sente.
Hope that helps?
Yep, that was it! It would be cool if this could be surfaced somehow in the error message. My current logging setup didn't catch it; I'll make a note to look into this.
It would be cool if this could be surfaced somehow in the error message.
As I showed above, the exception here already contains detailed information in the form of data (ex-data
).
This is quite typical/idiomatic for modern Clojure exceptions (since the advent of ex-info
in Clojure v1.4), and this has a lot of benefits.
Rather than try to duplicate/cram info into the error message string, these kinds of exceptions are a lot more expressive (support arbitrary rich data) and are much easier to work with programmatically since the error consumer can directly access relevant data for filtering, logging, and other tooling, etc.
Most (all?) logging tools developed with Clojure in mind should automatically float this attached data. As mentioned earlier, I'd encourage you to adopt such a tool since you'll otherwise keep running into the same problem - Sente's errors are not unique in this respect.
Hope that helps!
I'm getting the following error in my browser console when making this call:
(chsk-send! [:testing {:my "data"}] 5000 (fn [cb-reply] (prn "yes")))
. Is there any way this error message could be made more informative? As a new sente user I'm having a really hard time trying to determine what's wrong with mychsk-send!
call.