Fork me on GitHub
#fulcro
<
2024-05-07
>
Eric Dvorsak19:05:03

there's a few typo in the statechart source/doc: sfn -> script-fn and sfn -> exit-fn I wanted to make a PR but my editor has a radically different POV on how to indent that code and it makes too many unrelated changes

tony.kay22:05:59

Thanks…I need to announce the bugfix I did yesterday too 😕

tony.kay22:05:44

those helpers were actually broken (entry and exit-fn)

tony.kay22:05:18

fixed and pushed

🙌 1
Eric Dvorsak21:05:50

When calling fop/invoke-remote, what constitutes an error-event?

tony.kay22:05:44

whatever you’ve configured Fulcro to consider an error. By default a non-200 status code from the server I think

tony.kay22:05:11

I always beef this up a bit because I don’t generally like throwing as a way to indicate “known problems with a request”…I’d rather return something more constructive, but this also sometimes involves touching remote middleware on the client. For example, I install response middleware that can look for special signals that will cause a notification toast to pop up.

Eric Dvorsak19:05:27

ok, I ended up adding :remote-error? in my fulcro-app:

:remote-error?
           (fn [result]
             (or
              (app/default-remote-error? result)
              (some-> result :body vals first (contains? :com.wsscode.pathom.core/errors))
              (:com.wsscode.pathom3.connect.runner/attribute-errors (:body result))))
where the second expression in the or is the most common case of error for me, the errors map is made of a message and a data key, extracted from clojure exception or explicetely returned by the mutation