From 0aee21868933fffb877456ccb5e45f5350dc63ee Mon Sep 17 00:00:00 2001 From: mike-thompson-day8 Date: Fri, 8 May 2015 15:49:48 +1000 Subject: [PATCH] Improve comments on router. --- src/re_frame/router.cljs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/re_frame/router.cljs b/src/re_frame/router.cljs index 9b4fa1d..b4f6186 100644 --- a/src/re_frame/router.cljs +++ b/src/re_frame/router.cljs @@ -44,12 +44,14 @@ (try (handle event-v) - ;; Unhandled exceptions from event handlers must be managed as follows: - ;; - call the standard logging function "error" - ;; - allow them to continue to bubble up because the app, in production, + ;; If the handler throws: + ;; - allow the exception to bubble up because the app, in production, ;; may have hooked window.onerror and perform special processing. - ;; - But an exception which bubbles out will break the enclosing go-loop. + ;; - But an exception which bubbles up will break the enclosing go-loop. ;; So we'll need to start another one. + ;; - purge any pending events, because they are probably related to the + ;; event which just fell in a screaming heap. Not sane to handle further + ;; events if the prior event failed. (catch js/Object e (do ;; try to recover from this (probably uncaught) error as best we can