taoensso / carmine

Redis client + message queue for Clojure
https://www.taoensso.com/carmine
Eclipse Public License 1.0
1.15k stars 130 forks source link

Show additional error message when creating new listener. #235

Closed dimovich closed 4 years ago

dimovich commented 4 years ago

The following code will print only "Listener handler exception" during subscription. Which doesn't help much.

(car/with-new-pubsub-listener (:spec conn)
  {"update-db"
   (fn [[op _ [opts data]]]
     ,,,)}

  (car/subscribe "update-db"))

With the added ex-message one will also also get "nth not supported on this type: Long".

ptaoussanis commented 4 years ago

Hi @dimovich, thanks for the PR!

The following code will print only "Listener handler exception" during subscription.

What is printed will depend on the configuration of your environment. The underlying Throwable is already provided to the logger, so something like ex-message can already be called there.

I'd suggest that modifying the config is probably a better idea than modifying this particular logging call, since if (in general) you want exception messages printed with errors - it might be better to make make the change in one place (the logger) than in every logging call in your application.

Does that make sense?

dimovich commented 4 years ago

@ptaoussanis Thank you for the detailed explanation. You are right, I was using a modified timbre config, and totally forgot about that. When switching to default config the error is printed. Closing this PR.