#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Tue, 27 Sep 2016 12:50:17 +0200
changeset 20436 a4aae3f01bc1
parent 20435 54505346a337
child 20437 f36b7fbeea41
#FEATURE by cg class: GenericException added: #isProgramError query to ask an exception if it is due to a programmer's fault.
GenericException.st
--- a/GenericException.st	Fri Sep 23 17:16:38 2016 +0200
+++ b/GenericException.st	Tue Sep 27 12:50:17 2016 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1993 by Claus Gittinger
 	      All Rights Reserved
@@ -224,6 +226,7 @@
     self raiseErrorString:messageText
 ! !
 
+
 !GenericException class methodsFor:'accessing'!
 
 errorString
@@ -1129,6 +1132,14 @@
     "Created: / 23.7.1999 / 13:49:59 / stefan"
 !
 
+isProgramError
+    "redefined in all exceptions which are programmer's errors,
+     and which should probably not be ignored.
+     I.e. a global error handler should reject and let a debugger get control."
+
+    ^ false
+!
+
 isQuerySignal
     "return true, if this is a querySignal - always return false here"
 
@@ -2424,6 +2435,14 @@
 
 isNotification
     ^ false
+!
+
+isProgramError
+    "redefined in all exceptions which are programmer's errors,
+     and which should probably not be ignored.
+     I.e. a global error handler should reject and let a debugger get control."
+     
+    ^ self class isProgramError
 ! !
 
 !GenericException class methodsFor:'documentation'!