From d30bdb80178e01fb20a90f5c56dbd8e0c47efe19 Mon Sep 17 00:00:00 2001 From: Dave Della Costa Date: Fri, 12 Dec 2014 14:32:52 +0900 Subject: [PATCH] Adds try/catch block for bad views at loading time; bump version to 4.5 --- project.clj | 2 +- src/views/db/load.clj | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/project.clj b/project.clj index 1bcde1a..f7fae08 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject views "0.4.4" +(defproject views "0.4.5" :description "You underestimate the power of the SQL side" :url "https://github.com/diligenceengine/views" diff --git a/src/views/db/load.clj b/src/views/db/load.clj index 7f3c4ae..9405abc 100644 --- a/src/views/db/load.clj +++ b/src/views/db/load.clj @@ -21,8 +21,12 @@ 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." [db new-view templates view-map] - (->> view-map - (view-query db) - (into []) - (post-process-result-set new-view templates) - (hash-map new-view))) + (try + (->> view-map + (view-query db) + (into []) + (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)))))