GenericException.st
changeset 5984 2d5c04c9fab6
parent 5950 5757b9ba4ff2
child 5985 4bffb803f9e8
equal deleted inserted replaced
5983:79d6b249c899 5984:2d5c04c9fab6
   150         parameter:aParameter 
   150         parameter:aParameter 
   151         errorString:aString 
   151         errorString:aString 
   152         suspendedContext:sContext 
   152         suspendedContext:sContext 
   153         originator:origin.
   153         originator:origin.
   154 ! !
   154 ! !
   155 
       
   156 
   155 
   157 !GenericException class methodsFor:'Compatibility - ANSI'!
   156 !GenericException class methodsFor:'Compatibility - ANSI'!
   158 
   157 
   159 raiseSignal
   158 raiseSignal
   160     "actually raise an exception (whatever the proceedability is)."
   159     "actually raise an exception (whatever the proceedability is)."
  1142     "
  1141     "
  1143 
  1142 
  1144     "Modified: 15.1.1997 / 20:15:12 / cg"
  1143     "Modified: 15.1.1997 / 20:15:12 / cg"
  1145 ! !
  1144 ! !
  1146 
  1145 
  1147 
       
  1148 !GenericException methodsFor:'Compatibility - ANSI'!
  1146 !GenericException methodsFor:'Compatibility - ANSI'!
  1149 
  1147 
  1150 pass
  1148 pass
  1151     ^ self reject
  1149     ^ self reject
  1152 !
  1150 !
  1384           errorString:msg
  1382           errorString:msg
  1385           in:suspendedContext.
  1383           in:suspendedContext.
  1386 
  1384 
  1387 ! !
  1385 ! !
  1388 
  1386 
       
  1387 !GenericException methodsFor:'default values'!
       
  1388 
       
  1389 defaultResumeValue
       
  1390     ^ nil
       
  1391 !
       
  1392 
       
  1393 defaultReturnValue
       
  1394     ^ nil
       
  1395 ! !
       
  1396 
  1389 !GenericException methodsFor:'handler actions'!
  1397 !GenericException methodsFor:'handler actions'!
  1390 
  1398 
  1391 proceed
  1399 proceed
  1392     "Continue after the raise - the raise returns nil"
  1400     "Continue after the raise - the raise returns nil"
  1393 
  1401 
  1394     self proceedWith:nil.
  1402     self proceedWith:(self defaultResumeValue).
  1395 
  1403 
  1396     "cg: a strange example: 
  1404     "cg: a strange example: 
  1397         there are two cought errors here - can you spot them ?
  1405         there are two cought errors here - can you spot them ?
  1398 
  1406 
  1399      Object errorSignal handle:[:ex|
  1407      Object errorSignal handle:[:ex|
  1605     "Continue after the raise - the raise returns nil
  1613     "Continue after the raise - the raise returns nil
  1606      obsolete (use #proceed), retained for backwards compatibility"
  1614      obsolete (use #proceed), retained for backwards compatibility"
  1607 
  1615 
  1608     <resource:#obsolete>
  1616     <resource:#obsolete>
  1609 
  1617 
  1610     self obsoleteMethodWarning:'use #proceed'.
  1618     "/ self obsoleteMethodWarning:'use #proceed'.   "/ nope - ANSI defines #resume - sigh
  1611     ^ self proceedWith:nil
  1619     ^ self proceedWith:(self defaultResumeValue)
  1612 
  1620 
  1613     "Modified: / 2.3.1998 / 10:51:55 / stefan"
  1621     "Modified: / 2.3.1998 / 10:51:55 / stefan"
  1614 !
  1622 !
  1615 
  1623 
  1616 resumeWith:value
  1624 resumeWith:value
  1617     "Continue after the raise - the raise returns value
  1625     "Continue after the raise - the raise returns value
  1618      obsolete (use #proceedWith:), retained for backwards compatibility"
  1626      obsolete (use #proceedWith:), retained for backwards compatibility"
  1619 
  1627 
  1620     <resource:#obsolete>
  1628     <resource:#obsolete>
  1621 
  1629 
  1622     self obsoleteMethodWarning:'use #proceedWith:'.
  1630     "/ self obsoleteMethodWarning:'use #proceedWith:'.   "/ nope - ANSI defines #resume: - sigh
  1623     ^ self proceedWith:value
  1631     ^ self proceedWith:value
  1624 
  1632 
  1625     "Modified: / 2.3.1998 / 10:51:48 / stefan"
  1633     "Modified: / 2.3.1998 / 10:51:48 / stefan"
  1626 !
  1634 !
  1627 
  1635 
  1630 
  1638 
  1631     |con|
  1639     |con|
  1632 
  1640 
  1633     con := handlerContext.
  1641     con := handlerContext.
  1634     handlerContext := suspendedContext := nil.
  1642     handlerContext := suspendedContext := nil.
  1635     con unwind:nil
  1643     con unwind:(self defaultReturnValue)
  1636 
  1644 
  1637     "Modified: 27.3.1997 / 16:46:39 / cg"
  1645     "Modified: 27.3.1997 / 16:46:39 / cg"
  1638 !
  1646 !
  1639 
  1647 
  1640 return:value
  1648 return:value
  1956 ! !
  1964 ! !
  1957 
  1965 
  1958 !GenericException class methodsFor:'documentation'!
  1966 !GenericException class methodsFor:'documentation'!
  1959 
  1967 
  1960 version
  1968 version
  1961     ^ '$Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.47 2001-09-04 10:35:13 cg Exp $'
  1969     ^ '$Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.48 2001-09-07 11:22:06 cg Exp $'
  1962 ! !
  1970 ! !
  1963 GenericException initialize!
  1971 GenericException initialize!