From 945b4a2ade444ffc96495d3f44c66391a8763936 Mon Sep 17 00:00:00 2001 From: interp Date: Wed, 19 Feb 2003 18:45:57 +0000 Subject: [PATCH] failsafe if "which" is not executable. --- .../web-server/root/surflets/admin-profiling.scm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scheme/httpd/surflets/web-server/root/surflets/admin-profiling.scm b/scheme/httpd/surflets/web-server/root/surflets/admin-profiling.scm index fce8d21..ddfcf28 100644 --- a/scheme/httpd/surflets/web-server/root/surflets/admin-profiling.scm +++ b/scheme/httpd/surflets/web-server/root/surflets/admin-profiling.scm @@ -11,6 +11,7 @@ let-opt receiving primitives + handle-fatal-error ) (begin @@ -310,10 +311,13 @@ plot '~a' title 'SUrflet Profiling ~a' with lines" (profile req)) (define (search-executable exec-name) - (receive (status ports) (run/collecting (1) (which ,exec-name)) - (if (zero? status) - (read-line ports) - ""))) + (with-fatal-error-handler + ;; If `which' is unavailable, return nothing. + (lambda (condition decline) "") + (receive (status ports) (run/collecting (1) (which ,exec-name)) + (if (zero? status) + (read-line ports) + "")))) (define (emph text) `(font (@ (color "red")) ,text)) @@ -327,5 +331,4 @@ plot '~a' title 'SUrflet Profiling ~a' with lines" `(tr (td (@ (colspan 2)) ,(emph "Note: There is no executable.")))))) -;; TODO: check `where' tool )) \ No newline at end of file