AssertionFailedError.st
author Stefan Vogel <sv@exept.de>
Sun, 05 Apr 2020 00:21:37 +0200
changeset 25355 abe090376550
parent 24644 55f4e9a8de61
permissions -rw-r--r--
#DOCUMENTATION by stefan class: SignalSet comment/format in: #add:

"
 COPYRIGHT (c) 2007 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
"{ Package: 'stx:libbasic' }"

"{ NameSpace: Smalltalk }"

ExecutionError subclass:#AssertionFailedError
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Kernel-Exceptions-Errors'
!

!AssertionFailedError class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 2007 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
!

documentation
"
    Raised by failing assertions.
"
! !

!AssertionFailedError class methodsFor:'testing'!

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."

    ^ true
! !

!AssertionFailedError methodsFor:'printing & storing'!

description
    |descr|

    descr := super description.
    suspendedContext notNil ifTrue:[
        (descr includes:Character cr) ifTrue:[
            "/ is a multiline description
            (descr endsWith:Character cr) ifFalse:[
                "/ but does not end in one 
                "/ then add one, in the middle
                ^ descr,Character cr,'{assert in ', suspendedContext printString,'}'
            ].
        ].
        ^ descr,' {assert in ', suspendedContext printString,'}'
    ].
    ^ descr.
! !

!AssertionFailedError class methodsFor:'documentation'!

version
    ^ '$Header$'
! !