Remove explicit use of js/Error. Starting the process of making re-frame cljc-ready
This commit is contained in:
parent
6edebdeba4
commit
faece2fd0f
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue