listener: don't crash if pprint fails.

db4
John Benediktsson 2012-06-01 17:07:10 -07:00
parent cee0b9e854
commit 31d30c5302
1 changed files with 8 additions and 1 deletions

View File

@ -93,6 +93,13 @@ t error-summary? set-global
] tabular-output nl
] unless-empty ;
: print-stack ( seq -- )
[
[ short. ]
[ drop "~pprint error~" swap write-object nl ]
recover
] each ;
: trimmed-stack. ( seq -- )
dup length max-stack-items get > [
max-stack-items get cut*
@ -100,7 +107,7 @@ t error-summary? set-global
[ length number>string "(" " more items)" surround ] keep
write-object nl
] dip
] when stack. ;
] when print-stack ;
: datastack. ( datastack -- )
display-stacks? get [