After adding this, I still can't see an exception before the app dies. maanantai 6. maaliskuuta 2017 12.04.16 UTC+2 JokkeB kirjoitti: > > Thanks for the reply. > > I haven't tried catching any or all errors. Is it a false assumption that > an error should be logged if it comes from the main thread? Can an > exception in another thread kill the app? Anyways, I now added this piece > of code in main, like instructed in > https://stuartsierra.com/2015/05/27/clojure-uncaught-exceptions and let's > see what happens. Is this what you meant? > > (Thread/setDefaultUncaughtExceptionHandler > (reify Thread$UncaughtExceptionHandler > (uncaughtException [_ thread ex] > (log/error ex "Uncaught exception on" (.getName thread))))) > > > > lauantai 4. maaliskuuta 2017 13.02.53 UTC+2 Scott Bauer kirjoitti: >> >> Out of curiosity, have you tried catching any and all errors as opposed >> to expecting to see an error message logged upon the system dying? >> >> While searching for possible causes, I did come across this similar post >> <https://groups.google.com/forum/#!msg/clojure/xlbjGGk8qsY/m1fbElGT3PsJ> >> from a few years ago... not sure if it will help, but it may. >> >> >> On Friday, March 3, 2017 at 10:57:20 AM UTC-5, JokkeB wrote: >>> >>> I have an application which I run with "lein run". The main looks >>> something like this >>> >>> (defn -main [] >>> (log/info "start") >>> (log/info "channel returned" (async/<!! (start-server (socket-server >>> 9121) (websocket-server 9122)))) >>> (log/info "quit")) >>> >>> start-server returns a channel created with async/reduce which shouldn't >>> ever produce a value. I see the "start" logged, the application runs for a >>> day or two (not sure if the time is always the same) and then it closes >>> without any errors or without logging "channel returned" or "quit". >>> >>> If there is an error in my code and the program quits I should see the >>> "quit" message. If there is a memory leak or something I would assume I'd >>> get an error message. Has anyone experienced anything similar? >>> >>> Could the reason be running it with lein (I haven't tried a jar)? If so, >>> why? >>> >>>
-- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.