ExceptionHandlerSet.st
changeset 23305 daf30c8d685b
parent 22712 aa91ca850dc0
child 24734 008f54b2eb48
equal deleted inserted replaced
23304:eb5349cc3973 23305:daf30c8d685b
   124     "Created: / 26.7.1999 / 09:51:37 / stefan"
   124     "Created: / 26.7.1999 / 09:51:37 / stefan"
   125 ! !
   125 ! !
   126 
   126 
   127 !ExceptionHandlerSet methodsFor:'queries'!
   127 !ExceptionHandlerSet methodsFor:'queries'!
   128 
   128 
   129 accepts:anExceptionHandler
   129 accepts:aSignalOrExceptionClass
   130     "return true, if the receiver accepts the argument, aSignal.
   130     "return true, if the receiver accepts the argument, aSignal.
   131      (i.e. if any of the receiver's elements is aSignal or a parent of it)."
   131      (i.e. if any of the receiver's elements is aSignal or a parent of it)."
   132 
   132 
   133     self keysDo:[:eachExceptionHandler |
   133     self keysDo:[:eachExceptionHandler |
   134         (eachExceptionHandler==anExceptionHandler
   134         (eachExceptionHandler == aSignalOrExceptionClass
   135          or:[eachExceptionHandler accepts:anExceptionHandler]) ifTrue:[^ true].
   135          or:[eachExceptionHandler accepts:aSignalOrExceptionClass]) ifTrue:[^ true].
   136     ].
   136     ].
   137     ^ false
   137     ^ false
   138 
   138 
   139     "Created: / 26.7.1999 / 09:53:09 / stefan"
   139     "Created: / 26-07-1999 / 09:53:09 / stefan"
       
   140     "Modified (format): / 28-08-2018 / 11:28:00 / Claus Gittinger"
   140 !
   141 !
   141 
   142 
   142 exceptionHandlerFor:anException in:aContext
   143 exceptionHandlerFor:anException in:aContext
   143     "answer the exceptionHandler for anException from aContext."
   144     "answer the exceptionHandler for anException from aContext."
   144 
   145 
   199 
   200 
   200 handles:anException
   201 handles:anException
   201     "return true, if the receiver handles the argument, anException.
   202     "return true, if the receiver handles the argument, anException.
   202      (i.e. if any of the receiver's elements handles anException)."
   203      (i.e. if any of the receiver's elements handles anException)."
   203 
   204 
   204     self keysDo:[:eachExceptionHandler|
   205     ^ self accepts:(anException creator).
   205         (eachExceptionHandler handles:anException) ifTrue:[^ true]
   206     
   206     ].
   207 "/    self keysDo:[:eachExceptionHandler|
   207     ^ false
   208 "/        (eachExceptionHandler handles:anException) ifTrue:[^ true]
       
   209 "/    ].
       
   210 "/    ^ false
       
   211 
       
   212     "Modified: / 28-08-2018 / 11:28:30 / Claus Gittinger"
   208 ! !
   213 ! !
   209 
   214 
   210 !ExceptionHandlerSet methodsFor:'save evaluation'!
   215 !ExceptionHandlerSet methodsFor:'save evaluation'!
   211 
   216 
   212 handleDo:aBlock
   217 handleDo:aBlock