Fork me on GitHub
#clj-kondo
<
2020-05-21
>
dominicm14:05:36

I have a custom macro! I don't suppose there's something for a try variant already? I use pattern matching instead of a binding so you do this:

(try+
  (catch {:a ?a} (prn ?a)
  (catch Some.Class.Extending.IExceptionInfo {:b ?b} (prn ?b)))
I'm using meander for the binding - which I appreciate kondo won't support at least for a while. I was hoping I could do something to alleviate the pain though, as constrained as possible.

borkdude14:05:40

@dominicm not really I'm afraid, except for disabling unresolved symbols etc in this macro

dominicm14:05:59

Would it be possible to mark things unresolved only in catch?

borkdude15:05:06

don't think so, because it's not really a var, more like a macro local thing

borkdude15:05:14

unless you do something like :require [my.terrific.macro :refer [catch]]

dominicm16:05:36

I'll have to get my library very popular so I can pr it :)