add an overridable panic handler
This commit is contained in:
parent
dd02cc1fc4
commit
f6faf029cd
1 changed files with 3 additions and 0 deletions
|
@ -559,6 +559,8 @@ func cache { ... | with arg-amt id body ;
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func panic-handler { | "to be overridden"; }
|
||||||
|
|
||||||
def do-not-dump 0 =do-not-dump
|
def do-not-dump 0 =do-not-dump
|
||||||
func handle-panic { | with msg trace ;
|
func handle-panic { | with msg trace ;
|
||||||
program-name dup if {
|
program-name dup if {
|
||||||
|
@ -569,6 +571,7 @@ func handle-panic { | with msg trace ;
|
||||||
&println trace:foreach
|
&println trace:foreach
|
||||||
"\nPanic message:" println
|
"\nPanic message:" println
|
||||||
" " print msg println
|
" " print msg println
|
||||||
|
panic-handler
|
||||||
def map env =map
|
def map env =map
|
||||||
"SPL_PANIC_DUMP" env:get dup if {
|
"SPL_PANIC_DUMP" env:get dup if {
|
||||||
"Dumping because SPL_PANIC_DUMP is set." println
|
"Dumping because SPL_PANIC_DUMP is set." println
|
||||||
|
|
Loading…
Add table
Reference in a new issue