Fork me on GitHub
#chlorine-clover
<
2020-05-26
>
mauricio.szabo20:05:15

@seancorfield just published a new version that changed eval-and-render to return a promise. This means that if you (let [res (editor/eval-and-render ...)] (prn res)) you'll see the result being printed. I believe this can help on commands that take too long to run. eval-and-render now also returns :result (in case of success) or :error (on failure). It can return nil too, in case of some internal error, but I believe it'll happen only on some really edge-cases 🙂

seancorfield20:05:21

Cool! Thank you!

seancorfield20:05:12

What sort of thing will :error be in that situation @mauricio.szabo?

mauricio.szabo20:05:54

For example, (/ 10 0) - the exception will come inside :error But, (try (/ 10 0) (catch Throwable t t)) will come inside :result

seancorfield20:05:30

"the exception" -- just a message or an entire data structure?

mauricio.szabo20:05:19

Entire data structure. It's not "suitable for extension" yet, but it'll be soon~ish

mauricio.szabo20:05:38

(Something like that Browsable that we were having trouble)

seancorfield20:05:49

Just wanted to check before I put it in an Atom popup warning 🙂