Fork me on GitHub
#pathom
<
2022-10-31
>
pieterbreed08:10:54

I'm using the ::runner/wrap-resolver-error plugin with lenient mode so that I can have warning logs when attributes do fail:

(-> (pci/register {:com.wsscode.pathom3.error/lenient-mode? true}
                  registry)
    (p.plugin/register {::p.plugin/id 'err
                        :com.wsscode.pathom3.connect.runner/wrap-resolver-error
                        (fn [_] (fn [env node error]
                                  (log/warn {::pathom-error error
                                             ::pathom-env   env
                                             :msg
                                             (format "Error resolving attribute '%s': '%s'."
                                                     node
                                                     (ex-message error))})))}))
I'm noticing that on attributes that fail outright (ie with exceptions) this log statement gets triggered, but surprisingly attributes with {:com.wsscode.pathom3.error/cause :com.wsscode.pathom3.error/attribute-unreachable} does not go through this "resolver-error" fn. Is this intended behaviour? If so, why?

wilkerlucio22:11:17

yes, this is currently by design, but up for debate, what you think about opening a discussion (https://github.com/wilkerlucio/pathom3/discussions) so we can talk more about it?