Skip to content
This repository has been archived by the owner on Apr 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #14 from shopsmart/pre-launch-tweaks
Browse files Browse the repository at this point in the history
Pre launch tweaks
  • Loading branch information
levi-andrew-dixon committed Oct 26, 2016
2 parents 6599d0f + 6203bda commit ea8c422
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/clj_infrastructure/db.clj
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
"Returns true if this exception's message matches any of the substrings in fatal-exceptions and
false otherwise."
[e :- Throwable]
(let [msg (d/replace-nil (.getMessage e) "")
(let [ex-str (d/replace-nil (str e) "")
fatal-exception-messages (dbconfig {} :fatal-exceptions)]
(reduce (fn [fatal msg-substring] (if (str/includes? msg msg-substring) (reduced true))) false fatal-exception-messages)))
(reduce (fn [fatal ex-str-substring] (if (str/includes? ex-str ex-str-substring) (reduced true))) false fatal-exception-messages)))


(s/defn any-fatal-exceptions? :- s/Bool
Expand Down
3 changes: 1 addition & 2 deletions test/clj_infrastructure/db_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@


(def current-db :h2)

;(def current-db :redshift)

(defn test-table [basename] (str basename (System/getProperty "user.name"))) ; so it's impossible for two users' tests to conflict

Expand Down Expand Up @@ -483,7 +483,6 @@
(testing "The failed transaction's inserts rolled back."
(is (not (seq (query "select * from ${test-table} where id >= 10" CONNECTION conn))))))))


(testing "Validate (.setAutoCommit conn false) doesn't respect autocommit=false in db-do-commands."
(jdbc/with-db-connection [conn (config DB-SPEC)]

Expand Down

0 comments on commit ea8c422

Please sign in to comment.