Adds try/catch block for bad views at loading time; bump version to 4.5

This commit is contained in:
Dave Della Costa 2014-12-12 14:32:52 +09:00
parent 84a7c67156
commit d30bdb8017
2 changed files with 10 additions and 6 deletions

View file

@ -1,4 +1,4 @@
(defproject views "0.4.4" (defproject views "0.4.5"
:description "You underestimate the power of the SQL side" :description "You underestimate the power of the SQL side"
:url "https://github.com/diligenceengine/views" :url "https://github.com/diligenceengine/views"

View file

@ -21,8 +21,12 @@
the template config map, and the view-map itself. the template config map, and the view-map itself.
and returns a result-set for the new-views with post-fn functions applied to the data." and returns a result-set for the new-views with post-fn functions applied to the data."
[db new-view templates view-map] [db new-view templates view-map]
(->> view-map (try
(view-query db) (->> view-map
(into []) (view-query db)
(post-process-result-set new-view templates) (into [])
(hash-map new-view))) (post-process-result-set new-view templates)
(hash-map new-view))
(catch Exception e
(warn (.getMessage e))
(warn "Broken view sig: " (pr-str new-view)))))