aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/g-error.boot14
-rw-r--r--src/interp/sys-driver.boot5
2 files changed, 19 insertions, 0 deletions
diff --git a/src/interp/g-error.boot b/src/interp/g-error.boot
index 32ed1d72..2d7747d5 100644
--- a/src/interp/g-error.boot
+++ b/src/interp/g-error.boot
@@ -194,3 +194,17 @@ throwMessage(:msg) ==
if $printMsgsToFile then sayMSG2File msg'
spadThrow()
+
+++ Error handler for Lisp systems that support Common Lisp conditions.
+++ We don't want users to get dropped into the Lisp debugger.
+systemErrorHandler c ==
+ $NeedToSignalSessionManager := true
+ $BreakMode = "validate" =>
+ systemError ERROR_-FORMAT('"~a",[c])
+ not $inLispVM and $BreakMode in '(nobreak query resume) =>
+ $inLispVM := true
+ systemError ERROR_-FORMAT('"~a",[c])
+ $BreakMode = "letPrint2" =>
+ $BreakMode := nil
+ THROW("letPrint2",nil)
+
diff --git a/src/interp/sys-driver.boot b/src/interp/sys-driver.boot
index 1274564f..12f0a022 100644
--- a/src/interp/sys-driver.boot
+++ b/src/interp/sys-driver.boot
@@ -165,7 +165,12 @@ restart() ==
$currentLine := nil
openDatabases()
readSpadProfileIfThere()
+)if %hasFeature KEYWORD::GCL
spad()
+)else
+ SETQ(_*DEBUGGER_-HOOK_*,LAMBDA(c h, systemErrorHandler c))
+ !(handler-bind ((error #'|systemErrorHandler|)) (|spad|))
+)endif
--%