Added warn-errors?, like ignore-errors, to turn errors into warnings.
authorMatt Birkholz <matt@birkholz.chandler.az.us>
Thu, 12 Jul 2012 22:01:21 +0000 (15:01 -0700)
committerMatt Birkholz <matt@birkholz.chandler.az.us>
Thu, 12 Jul 2012 22:01:21 +0000 (15:01 -0700)
src/runtime/error.scm
src/runtime/runtime.pkg

index e01ace41d2e5b4ed5f19ffb2587bbded86669d7d..502a5f1233f8e7551419a626b9221718dbfb67b7 100644 (file)
@@ -1230,6 +1230,14 @@ USA.
                                           'IGNORE-ERRORS)))
        thunk))))
 
+(define warn-errors?
+  (let ((ok "ok"))
+    (lambda (thunk)
+      (let ((v (ignore-errors (lambda () (thunk) ok))))
+       (cond ((eq? v ok) #f)
+             ((condition? v) (warn v) #t)
+             (else (error "Unexpected value:" v)))))))
+
 (define (format-error-message message irritants port)
   (fluid-let ((*unparser-list-depth-limit* 2)
              (*unparser-list-breadth-limit* 5))
index 23ee71521f7c61407f884d26dfd4eba8d9cb51c1..2e64aa00a7c559aa857599f95b291fe619a93e2a 100644 (file)
@@ -1817,6 +1817,7 @@ USA.
          format-error-message
          hook/invoke-condition-handler
          ignore-errors
+         warn-errors?
          invoke-restart
          invoke-restart-interactively
          make-condition