I'm getting a js/Error
in my catch
form of try/catch
. I was doing some repl work to see what I can understand about js/Error
s. What I don't understand is why (js->clj js-err)
just returns the same js/Error
object.
(def js-err (js/Error. "testing"))
js-err
;; => #object[Error Error: testing]
(js->clj js-err)
;; => #object[Error Error: testing]
evaluating js-err
and (js->clj js-err)
result in the same thing.
Here are the properties on js-err
(.getOwnPropertyNames js/Object js-err)
;; => #js["stack" "message"]
what I want or expect to happen:
(js->clj js-err)
;; => {:message "testing"
;; :stack "blah\nblah"}
Could someone explain why js->clj
doesn't give me the object data as a map, and is there a idiomatic way to accomplish turning that object into a map?
This is in the nodejs host