diff --git a/src/clj/pmagnus/elprice/core.clj b/src/clj/pmagnus/elprice/core.clj index 9d364db..a661f22 100644 --- a/src/clj/pmagnus/elprice/core.clj +++ b/src/clj/pmagnus/elprice/core.clj @@ -19,9 +19,12 @@ ;; log uncaught exceptions in threads (Thread/setDefaultUncaughtExceptionHandler (fn [thread ex] - (log/error {:what :uncaught-exception - :exception ex - :where (str "Uncaught exception on" (.getName thread))}))) + ;; Integrant exceptions include component configuration in ex-data. Logging + ;; the exception object can therefore disclose database or cookie secrets. + (log/error {:what :uncaught-exception + :exception-class (.getName (class ex)) + :message (.getMessage ex) + :where (str "Uncaught exception on " (.getName thread))}))) (defonce system (atom nil)) diff --git a/test/clj/pmagnus/elprice/core_test.clj b/test/clj/pmagnus/elprice/core_test.clj index 01c09cb..ffc778f 100644 --- a/test/clj/pmagnus/elprice/core_test.clj +++ b/test/clj/pmagnus/elprice/core_test.clj @@ -3,5 +3,6 @@ [clojure.test :refer [deftest is]] [pmagnus.elprice.core :as core])) + (deftest system-state-is-managed-in-an-atom (is (instance? clojure.lang.Atom core/system)))