Currently, when an attribute is requested as optional and there is no return, Pathom will return the rest of the data. The same isn't true when that optional requirement path triggers an exception. Example case:
(pco/defresolver error-attr []
{:error (throw (ex-info "Error" {}))})
(def env
(-> {}
(pci/register [error-attr])))
(p.eql/process env [(pco/? :error)])
This should change, and Pathom should ignore exceptions related to optional attributes. It should also be aware if the error happened while computing a dependency for some optional attribute. For example:
(pco/defresolver error-attr []
{:error (throw (ex-info "Error" {}))})
(def env
(-> {}
(pci/register
[error-attr
(pbir/alias-resolver :error :error-dep)])))
(p.eql/process env [(pco/? :error-dep)])
Currently, when an attribute is requested as optional and there is no return, Pathom will return the rest of the data. The same isn't true when that optional requirement path triggers an exception. Example case:
This should change, and Pathom should ignore exceptions related to optional attributes. It should also be aware if the error happened while computing a dependency for some optional attribute. For example: