Fork me on GitHub
#meander
<
2020-06-22
>
pithyless12:06:05

Is there an idiomatic way in meander to match the ex-message and ex-data parts of an exception (not in try/catch, just as some data that's embedded in a map)?

noprompt16:06:46

Like

(m/app ex-data {:error/type ?error-type})
kinda thing?

pithyless20:06:08

yeah, so I guess something like this is appropriate?

(m/and (m/app ex-message "Some Error")
       (m/app ex-data {:some :data}))

noprompt23:06:35

(m/defsyntax ex [message data]
  `(m/and (m/app ex-message ~message)
          (m/app ex-data ~data)))

noprompt23:06:46

(If its common enough to warrant.)