Fork me on GitHub
#beginners
<
2017-03-03
>
olegakbarov10:03:13

Guys, im curious what’s the right way to do something similar to saga pattern in clojure? i have around 6 steps each with http request and i’d like to handle errors and retry on each of them

val_waeselynck11:03:29

@olegakbarov what are you missing specifically to Clojure ?

olegakbarov11:03:06

im not sure that 6 level ladder of callbacks is way-to-go for me

olegakbarov11:03:17

so i guess i somehow should utilize core.async

olegakbarov11:03:26

but struggling to find reference

joshkh11:03:20

what's the difference between :require-macros and :refer-macros?

val_waeselynck11:03:25

@olegakbarov maybe you should try to write it with synchronous code first, then use core.async to make it non-blocking

joshkh11:03:29

(in clojurescript)

lepistane11:03:52

can i ask questions about emacs here?

Sam H11:03:56

might have better luck in the #emacs chan

lepistane11:03:10

no one is there 😞 but oki

Sam H11:03:12

@lepistane you could try out spacemacs as it has nice defaults. It basically packages up a load of packages into layers #spacemacs

vinai12:03:57

Why isn't :b wrote something logged?

b0612:03:16

I've followed http://acidwords.com/posts/2015-07-23-fixing-negation-in-clojure-test.html in order to have negation tests for thrown?

b0612:03:30

(defmacro is-not-thrown? [e expr]
  `(is (not ('thrown? ~e ~expr))))

b0612:03:09

but everytime I call it in an assertion I get an error like the one below:

FAIL in () (form-init8859583272323518059.clj:1)
expected: (clojure.core/not ((quote api-test/thrown?) Exception {:body 12}))
  actual: (not (clojure.core/not {:body 12}))

payal20:03:00

Has anyone encountered this kind of error before: JSON error (unexpected character): &lt; I am getting this error while parsing a response. As many stackoverflow posts say , I am not parsing already parsed response

7h3kk1d20:03:29

Have you run it through a json validator?

7h3kk1d20:03:34

To make sure it’s properly formed json

seancorfield20:03:06

If you’re getting < that sounds like you’re getting HTML back instead of JSON. Can you hit the same URL via curl or in a browser to see what response you’re really getting?

timgilbert21:03:56

Yeah, I've often seen similar things when I'm calling a web service that is supposed to return JSON, but the back-end throws an exception so it returns an HTML error page instead

dpsutton21:03:51

a coworker walked in and i pretended to be busy. did not mean to post it though 🙂

payal22:03:08

Thanks for the response everyone..

payal22:03:56

@7h3kk1d hmm its not actually.. I am trying through curl as @seancorfield is suggesting to see what exactly it is returning

7h3kk1d22:03:38

If you can post the output we can probably say what’s wrong.

7h3kk1d22:03:57

If not and it looks like json I’d try removing parts of it to see where the mistake is

payal22:03:24

I am afraid I can post it here , there is some processing done on response before it even reaches that point. I am guessing there is some magic happening there..

7h3kk1d22:03:45

That makes sense.