Fork me on GitHub
#fulcro
<
2019-04-30
>
exit218:04:35

Whats the best way to handle errors from the API on a df/load-action? Wrap in try/catch?

currentoor19:04:04

what type of errors?

currentoor19:04:51

try/catch will only catch errors that happen when you invoke df/load-action not any load/network/response handling related errors

currentoor19:04:33

df/load-action merely queues a load to take place when the network component is ready

exit214:05:45

errors from the remote fetch

exit214:05:06

I wrapped the actual api call in a try/catch and passed the error if it exists - seems to be working now

souenzzo19:04:23

from fulcro.client/Application I access shared via (-> app :reconciler-options :shared) Should fp/shared accept Application ?

tony.kay21:04:07

why are you accessing shared that way??? Shared takes a component, doesn’t it?

tony.kay21:04:52

(prim/shared this). See the book on using shared. The fact that it is held in an internal place in the reconciler options is not something you should ever use directly.