Re: Exception propagation design in Clojure web APIs.

2013-03-24 Thread Julien Dreux
For anyone looking to do something similar (i.e. using exception control flow for handling request errors & validation), I found the slingshot library invaluable for enhanced try and throw leveraging Clojure. Going with 'native' try/throw was becoming ni

Re: Exception propagation design in Clojure web APIs.

2013-03-20 Thread Julien Dreux
UTC+1, Julien Dreux wrote: > >> Thank you all for your answers, >> >> I like Marko's approach. >> >> What I had in mind, related to OP's post, would be a middleware that does >>> (binding [*validation-failures* []] >>>(handler req)

Re: Exception propagation design in Clojure web APIs.

2013-03-20 Thread Julien Dreux
Thank you all for your answers, I like Marko's approach. What I had in mind, related to OP's post, would be a middleware that does > (binding [*validation-failures* []] >(handler req) >(do-something-about *validation-failures*)) > There would be a global function, such as *add-failure

Exception propagation design in Clojure web APIs.

2013-03-19 Thread Julien Dreux
Hi all, Coming from a Java background, I am having a hard time understanding how validation error propagation should work in clojure web APIs. To be clear, this is similar to how my Java web service would be setup: /** Method that validates the model, accesses the DB. If something went wrong,