MessageNotUnderstood.st
author Claus Gittinger <cg@exept.de>
Fri, 05 Mar 2004 18:28:27 +0100
changeset 8081 b468050174a9
parent 7586 63e4900c8931
child 8501 8e114640aa5c
permissions -rw-r--r--
initial checkin
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7586
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
     1
"
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
     2
 COPYRIGHT (c) 2001 by eXept Software AG
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
     3
              All Rights Reserved
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
     4
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
     5
 This software is furnished under a license and may be used
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
     6
 only in accordance with the terms of that license and with the
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
     8
 be provided or otherwise made available to, or used by, any
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
     9
 other person.  No title to or ownership of the software is
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    10
 hereby transferred.
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    11
"
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    12
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
"{ Package: 'stx:libbasic' }"
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
Error subclass:#MessageNotUnderstood
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	instanceVariableNames:''
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	classVariableNames:''
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	poolDictionaries:''
6210
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    19
	category:'Kernel-Exceptions-Errors'
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
!
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
6210
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    22
!MessageNotUnderstood class methodsFor:'documentation'!
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    23
7586
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    24
copyright
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    25
"
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    26
 COPYRIGHT (c) 2001 by eXept Software AG
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    27
              All Rights Reserved
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    28
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    29
 This software is furnished under a license and may be used
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    30
 only in accordance with the terms of that license and with the
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    32
 be provided or otherwise made available to, or used by, any
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    33
 other person.  No title to or ownership of the software is
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    34
 hereby transferred.
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    35
"
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    36
!
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    37
6210
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    38
documentation
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    39
"
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    40
    raised when a message is sent to an object, which is not understood
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    41
    by the receiver, and the message was not handled by a class specific
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    42
    doesNotUnderstand: handler.
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    43
"
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    44
! !
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
!MessageNotUnderstood class methodsFor:'queries'!
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
mayProceed
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
    "Return true, because messageNotUnderstood is proceedable (with nil)."
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
    ^ true
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
! !
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
6667
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    54
!MessageNotUnderstood class methodsFor:'save evaluation'!
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    55
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    56
ignoreNotUnderstoodOf:aSelector in:aBlock
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    57
    "evaluate aBlock; if a messageNotUnderstood occurs,
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    58
     for which the message was aSelector, ignore the error
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    59
     and return.
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    60
     Other selector errors lead into the debugger.
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    61
     If no error occurs, return the blocks value"
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    62
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    63
    ^ self handle:[:ex |
6669
992abad6f5aa *** empty log message ***
ca
parents: 6668
diff changeset
    64
        ex selector == aSelector ifFalse:[
6667
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    65
            ex reject
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    66
        ]
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    67
    ] do:aBlock.
6668
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    68
!
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    69
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    70
ignoreNotUnderstoodOfAny:aCollectionOfSelectors in:aBlock
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    71
    "evaluate aBlock; if a messageNotUnderstood occurs,
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    72
     for which the message was any in aCollectionOfSelectors, ignore the error
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    73
     and return.
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    74
     Other selector errors lead into the debugger.
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    75
     If no error occurs, return the blocks value"
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    76
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    77
    ^ self handle:[:ex |
6669
992abad6f5aa *** empty log message ***
ca
parents: 6668
diff changeset
    78
        (aCollectionOfSelectors includesIdentical:ex selector) ifFalse:[
6668
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    79
            ex reject
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    80
        ]
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    81
    ] do:aBlock.
6667
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    82
! !
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    83
5982
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    84
!MessageNotUnderstood methodsFor:'accessing'!
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    85
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    86
message
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    87
    ^ parameter
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    88
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    89
    "
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    90
     [
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    91
        123 perform:#foo
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    92
     ] on:MessageNotUnderstood do:[:ex |
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    93
        Transcript show:'message object: '; showCR:ex message storeString.
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    94
        Transcript show:'receiver: '; showCR:ex receiver storeString.
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    95
        Transcript show:'selector: '; showCR:ex message selector storeString.
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    96
        Transcript show:'arguments: '; showCR:ex message arguments storeString.
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    97
     ]
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    98
    "
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    99
!
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   100
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   101
receiver
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   102
    ^ originator
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   103
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   104
    "
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   105
     [
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   106
        123 perform:#foo
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   107
     ] on:MessageNotUnderstood do:[:ex |
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   108
        Transcript showCR:ex receiver
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   109
     ]
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   110
    "
6668
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   111
!
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   112
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   113
selector
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   114
    ^ parameter selector
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   115
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   116
    "
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   117
     [
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   118
        123 perform:#foo
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   119
     ] on:MessageNotUnderstood do:[:ex |
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   120
        Transcript show:'selector: '; showCR:ex selector storeString.
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   121
     ]
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   122
    "
5982
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   123
! !
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   124
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
!MessageNotUnderstood class methodsFor:'documentation'!
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
version
7586
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
   128
    ^ '$Header: /cvs/stx/stx/libbasic/MessageNotUnderstood.st,v 1.7 2003-08-29 19:15:14 cg Exp $'
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
! !