make-exception recoverable-exception
make-exception unrecoverable-exception
-: display-warning ( addr count -- )
+: display-exception-msg ( addr count -- )
bold fg red
." Exception: "
type
[compile] if
['] -rot ,
- ['] display-warning ,
+ ['] display-exception-msg ,
[compile] then
['] throw ,
;
: (printstring) ( stringobj -- )
- nil-type istype? if 2drop exit then
+ nil? if 2drop exit then
2dup car drop dup
case
recoverable-exception of false endof
unrecoverable-exception of true endof
- \ Rethrow anything else:
- throw
-
- \ If we're still here, loop again
- false
+ throw false
endcase
until
;