Remove explicit use of js/Error. Starting the process of making re-frame cljc-ready

This commit is contained in:
Mike Thompson 2016-07-19 18:37:03 +10:00
parent 6edebdeba4
commit faece2fd0f
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@
"throw an exception if db doesn't match the schema."
[a-schema db]
(if-let [problems (s/check a-schema db)]
(throw (js/Error. (str "schema check failed: " problems)))))
(throw (ex-info "schema check failed: " {:problems problems}))))
;; Event handlers change state, that's their job. But what happens if there's
;; a bug and it corrupts this state in some subtle way? This middleware is run after

View File

@ -144,7 +144,7 @@
[:paused :add-event] [:paused #(-add-event this arg)]
[:paused :resume ] [:running #(-resume this)]
(throw (js/Error. (str "re-frame: router state transition not found. " fsm-state " " trigger))))]
(throw (ex-info "re-frame: router state transition not found" {:fsm-state fsm-state :trigger trigger})))]
;; The "case" above computed both the new FSM state, and the action. Now, make it happen.
(set! fsm-state new-fsm-state)