" Error recovery " { import: Object } String backtrace [ ^self value_: self _backtrace ] String _backtrace { return (oop)_backtrace(); } Object doesNotUnderstand: aSelector [ StdErr nextPutAll: (self printString, ' does not understand ', aSelector); cr. StdErr nextPutAll: String backtrace; cr. self exit1. ] Restart := [ nil ] Object setRestart: aBlock [ Restart := aBlock ] Object exit1 [ Restart value ] Object halt [ StdErr cr. StdErr backtrace. StdErr cr; nextPutAll: 'halt'; cr. self exit1. ] Object error: reason [ StdErr cr. StdErr backtrace. StdErr cr; nextPutAll: reason; cr. self exit1. ] Object shouldNotImplement: aSelector [ StdErr cr. StdErr backtrace. StdErr cr; nextPutAll: self debugName; nextPutAll: ' should not implement '; print: aSelector; cr. self exit1. ] Object subtypeResponsibility: aSelector [ StdErr cr. StdErr backtrace. StdErr cr; nextPutAll: self debugName; nextPutAll: ' did not override '; print: aSelector; cr. self exit1. ] Object errorOutOfBounds: anIndex [ StdErr cr. StdErr backtrace. StdErr cr; print: anIndex; nextPutAll: ' is out of bounds in '; nextPutAll: self debugName; nextPut: $(; print: self size; nextPut: $); cr. self exit1. ] Object errorKeyNotFound: aKey [ StdErr cr. StdErr backtrace. StdErr cr; print: aKey; nextPutAll: ' is not a key in '; nextPutAll: self debugName; cr. self exit1. ]