rm-hull / programming-enchiladas

A ClojureScript-based HTML5 Canvas and SVG Graphics Playground, much like http://bl.ocks.org/ but specifically for showcasing small ClojuresScript code demos: The underlying agenda is to show how small simple functional programs can generate complex behaviour.
programming-enchiladas.destructuring-bind.org
138 stars 18 forks source link

Handle case where mongo docs out of date w.r.t. cached json #6

Closed rm-hull closed 10 years ago

rm-hull commented 10 years ago

If json cache file are not found locally, remove mongo record, rather than throwing following exception

Caused by: java.io.FileNotFoundException: work/gists/cache/mrev/7557710.json (No such file or directory)
               (Unknown Source) java.io.FileInputStream.open
       FileInputStream.java:146 java.io.FileInputStream.<init>
                     io.clj:229 clojure.java.io/fn
                      io.clj:69 clojure.java.io/fn[fn]
                     io.clj:258 clojure.java.io/fn
                      io.clj:69 clojure.java.io/fn[fn]
                     io.clj:165 clojure.java.io/fn
                      io.clj:69 clojure.java.io/fn[fn]
                     io.clj:102 clojure.java.io/reader
                RestFn.java:410 clojure.lang.RestFn.invoke
                      fs.clj:63 enchilada.util.fs/fetch-gist
                  core.clj:2403 clojure.core/comp[fn]
                  core.clj:6466 clojure.core/pmap[fn]
                  core.clj:1910 clojure.core/binding-conveyor-fn[fn]
                    AFn.java:18 clojure.lang.AFn.call
            FutureTask.java:262 java.util.concurrent.FutureTask.run
   ThreadPoolExecutor.java:1145 java.util.concurrent.ThreadPoolExecutor.runWorker
    ThreadPoolExecutor.java:615 java.util.concurrent.ThreadPoolExecutor$Worker.run