From d86d0a00e88b1d11373e06f8a9f83be7d772af25 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 15 Feb 2021 14:25:09 -0800 Subject: [PATCH] trap fewer exceptions --- pollen/private/ts.rktd | 2 +- pollen/setup.rkt | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pollen/private/ts.rktd b/pollen/private/ts.rktd index c29ff89..b9fce1c 100644 --- a/pollen/private/ts.rktd +++ b/pollen/private/ts.rktd @@ -1 +1 @@ -1612984970 +1613427909 diff --git a/pollen/setup.rkt b/pollen/setup.rkt index e03d223..fb78596 100644 --- a/pollen/setup.rkt +++ b/pollen/setup.rkt @@ -52,6 +52,13 @@ ;; but if something else is amiss, we want to let it bubble up (define setup-module-path (get-path-to-override dir)) (with-handlers ([exn:fail:contract? (λ (exn) DEFAULT-NAME)] + ;; a syntax error in pollen.rkt will arrive here + ;; exn:fail:read? for a syntactic failure (e.g., missing paren) + ;; exn:fail:syntax? for a semantic failure, (e.g., unbound identifier) + ;; it does not indicate a defective setup module, + ;; so pass it through + [exn:fail:read? raise] + [exn:fail:syntax? raise] [exn? (λ (exn) (raise-user-error 'pollen/setup (format "defective `setup` submodule in ~v\n~a" (path->string setup-module-path) (exn-message exn))))]) (dynamic-require `(submod ,setup-module-path WORLD-SUBMOD)