#BUGFIX by cg
authorClaus Gittinger <cg@exept.de>
Fri, 10 Jan 2020 21:43:58 +0100
changeset 25186 13abf9897f03
parent 25185 c69a46903233
child 25187 81d3d4761e81
#BUGFIX by cg class: Object changed: #inspector2TabJSON #printStringLimitedTo:
Object.st
--- a/Object.st	Fri Jan 10 15:35:15 2020 +0100
+++ b/Object.st	Fri Jan 10 21:43:58 2020 +0100
@@ -5898,7 +5898,6 @@
     "Modified: / 26.7.1999 / 10:58:49 / stefan"
 ! !
 
-
 !Object methodsFor:'message sending'!
 
 perform:aSelector
@@ -8000,18 +7999,22 @@
 !
 
 printStringLimitedTo:sizeLimit
-    "return a string for printing the receiver, but limit the result string in its size."
+    "return a string for printing the receiver, but limit the result string in its size.
+     (i.e. silently truncate the string)"
 
     |s|
 
     s := CharacterWriteStream on:(String basicNew:30).
     s writeLimit:sizeLimit.
-    self printOn:s.
+    WriteError handle:[:ex |
+    ] do:[
+        self printOn:s.
+    ].
     ^ s contents.
 
     "
-     Date today printStringLimitedTo:5.
-     '12345678901234567890' printStringLimitedTo:5.
+     Date today printStringLimitedTo:5.     
+     '12345678901234567890' printStringLimitedTo:5.   
     "
 !