Re: noob question about try/catch

2013-04-27 Thread Neale Swinnerton
On Fri, Apr 26, 2013 at 5:55 PM, Michael Gardner > I believe Clojure is wrapping the java.sql.SQLException in a > java.lang.RuntimeException because of reasons[1][2], so you'd need to catch > java.lang.RuntimeException and examine the exception's cause property to > get the "real" exception. > > A

Re: noob question about try/catch

2013-04-26 Thread Sean Corfield
What does your code look like that queries MySQL? The above code writes to MongoDB which is not going to throw SQLException anyway. On Fri, Apr 26, 2013 at 8:01 AM, larry google groups wrote: > > I wrote a simple app that gets my data out of an old mysql database and puts > it into mongodb. I hav

Re: noob question about try/catch

2013-04-26 Thread Michael Gardner
On Apr 26, 2013, at 11:55 , Michael Gardner wrote: > I believe Clojure is wrapping the java.sql.SQLException in a > java.lang.RuntimeException because of reasons[1][2], so you'd need to catch > java.lang.RuntimeException and examine the exception's cause property to get > the "real" exception.

Re: noob question about try/catch

2013-04-26 Thread Michael Gardner
On Apr 26, 2013, at 10:01 , larry google groups wrote: > java.lang.RuntimeException: java.sql.SQLException: Cannot convert value > '-00-00 00:00:00' from column 6 to TIMESTAMP. I believe Clojure is wrapping the java.sql.SQLException in a java.lang.RuntimeException because of reasons[1][2]

Re: noob question about try/catch

2013-04-26 Thread larry google groups
> See http://clojure.org/special_forms#try , you're still responsible for the > logic in the catch to ignore the exception. But I have caught the exceptions, so why do they kill my app? You link to this, which does not answer the question: "The exprs are evaluated and, if no exceptions occ

Re: noob question about try/catch

2013-04-26 Thread George Oliver
On Friday, April 26, 2013 8:01:45 AM UTC-7, larry google groups wrote: > > > I thought I had written the try/catch blog so that this exception would be > logged, but otherwise ignored. > > Instead, this exception stops my app cold -- the app stops. > > > See http://clojure.org/special_forms#tr

noob question about try/catch

2013-04-26 Thread larry google groups
I wrote a simple app that gets my data out of an old mysql database and puts it into mongodb. I have this function: (defn add-this-record-to-mongo [db record item-type] (println (str (:user db))) (println (str item-type)) (try (let [record (assoc record :item-type item-type)