MessageNotUnderstood.st
author Stefan Vogel <sv@exept.de>
Tue, 28 Apr 2020 14:38:55 +0200
changeset 25370 c417f7edaec1
parent 24592 b003befd8100
permissions -rw-r--r--
#BUGFIX by stefan class: OrderedCollection class removed: #with: already inherited from superclass
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
"
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libbasic' }"
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
18290
5ea0b888d79d class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 16414
diff changeset
    14
"{ NameSpace: Smalltalk }"
5ea0b888d79d class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 16414
diff changeset
    15
20447
4b8519e42c13 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18302
diff changeset
    16
ExecutionError subclass:#MessageNotUnderstood
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	instanceVariableNames:''
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	classVariableNames:''
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	poolDictionaries:''
6210
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    20
	category:'Kernel-Exceptions-Errors'
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
6210
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    23
!MessageNotUnderstood class methodsFor:'documentation'!
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    24
7586
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    25
copyright
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    26
"
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    27
 COPYRIGHT (c) 2001 by eXept Software AG
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    28
              All Rights Reserved
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    29
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    30
 This software is furnished under a license and may be used
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    31
 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
    32
 inclusion of the above copyright notice.   This software may not
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    33
 be provided or otherwise made available to, or used by, any
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    34
 other person.  No title to or ownership of the software is
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    35
 hereby transferred.
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
!
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    38
6210
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    39
documentation
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    40
"
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    41
    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
    42
    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
    43
    doesNotUnderstand: handler.
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    44
"
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    45
! !
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
15188
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
    47
!MessageNotUnderstood class methodsFor:'initialization'!
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
    48
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
    49
initialize
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
    50
    NotifierString := 'message not understood'.
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
    51
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
    52
    "
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
    53
     self initialize
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
    54
    "
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
    55
! !
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
    56
6667
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    57
!MessageNotUnderstood class methodsFor:'save evaluation'!
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    58
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    59
ignoreNotUnderstoodOf:aSelector in:aBlock
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    60
    "evaluate aBlock; if a messageNotUnderstood occurs,
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    61
     for which the message was aSelector, ignore the error
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    62
     and return.
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    63
     Other selector errors lead into the debugger.
23887
690af9f439a5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23656
diff changeset
    64
     If no error occurs, return the block's value"
6667
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    65
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    66
    ^ self handle:[:ex |
6669
992abad6f5aa *** empty log message ***
ca
parents: 6668
diff changeset
    67
        ex selector == aSelector ifFalse:[
6667
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    68
            ex reject
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    69
        ]
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    70
    ] do:aBlock.
23887
690af9f439a5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23656
diff changeset
    71
690af9f439a5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23656
diff changeset
    72
    "Modified (comment): / 13-03-2019 / 10:26:10 / Claus Gittinger"
6668
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    73
!
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    74
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    75
ignoreNotUnderstoodOfAny:aCollectionOfSelectors in:aBlock
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    76
    "evaluate aBlock; if a messageNotUnderstood occurs,
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    77
     for which the message was any in aCollectionOfSelectors, ignore the error
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    78
     and return.
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    79
     Other selector errors lead into the debugger.
23887
690af9f439a5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23656
diff changeset
    80
     If no error occurs, return the block's value"
6668
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    81
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    82
    ^ self handle:[:ex |
6669
992abad6f5aa *** empty log message ***
ca
parents: 6668
diff changeset
    83
        (aCollectionOfSelectors includesIdentical:ex selector) ifFalse:[
6668
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    84
            ex reject
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    85
        ]
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    86
    ] do:aBlock.
23887
690af9f439a5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23656
diff changeset
    87
690af9f439a5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23656
diff changeset
    88
    "Modified (comment): / 13-03-2019 / 10:26:14 / Claus Gittinger"
6667
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    89
! !
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    90
5982
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    91
!MessageNotUnderstood methodsFor:'accessing'!
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    92
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    93
message
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    94
    ^ parameter
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    95
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    96
    "
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
        123 perform:#foo
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    99
     ] on:MessageNotUnderstood do:[:ex |
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   100
        Transcript show:'message object: '; showCR:ex message storeString.
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   101
        Transcript show:'receiver: '; showCR:ex receiver storeString.
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   102
        Transcript show:'selector: '; showCR:ex message selector storeString.
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   103
        Transcript show:'arguments: '; showCR:ex message arguments storeString.
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
!
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   107
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   108
receiver
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   109
    ^ originator
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   110
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   111
    "
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   112
     [
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   113
        123 perform:#foo
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   114
     ] on:MessageNotUnderstood do:[:ex |
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   115
        Transcript showCR:ex receiver
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   116
     ]
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   117
    "
6668
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   118
!
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   119
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   120
selector
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   121
    ^ parameter selector
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   122
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   123
    "
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   124
     [
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   125
        123 perform:#foo
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   126
     ] on:MessageNotUnderstood do:[:ex |
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   127
        Transcript show:'selector: '; showCR:ex selector storeString.
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   128
     ]
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   129
    "
5982
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   130
! !
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   131
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   132
!MessageNotUnderstood methodsFor:'printing & storing'!
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   133
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   134
description
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   135
    "the human readable description of the exception"
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   136
24592
b003befd8100 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 24111
diff changeset
   137
    |rcvr searchClass sel description sender|
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   138
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   139
    "extract the class that should have implemented the message.
16414
718569261384 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 15188
diff changeset
   140
     (in case of a super-send, this is not the receiver's class)"
18302
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   141
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   142
    "/ suspendedContext is the actual doesNotUnderstand context;
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   143
    "/ its sender is the bad (failing) one, which has the search class information
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   144
    "/ (the doesNotUnderstand is always an undirected send)
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   145
    "/ Q: is that correct VM-behavior?
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   146
    "/ One might argue, that the DNU should be also directed 
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   147
    "/ (or else add the searchClass information to the Message object)
8657
1df84e8daa15 care for nil suspendedContext in description
penk
parents: 8501
diff changeset
   148
    suspendedContext notNil ifTrue:[
18302
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   149
        searchClass := suspendedContext searchClass.
18290
5ea0b888d79d class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 16414
diff changeset
   150
        (sender := suspendedContext sender) notNil ifTrue:[
18302
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   151
            "/ just in case, this gets ever fixed
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   152
            sender receiver == suspendedContext receiver ifTrue:[
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   153
                searchClass := sender searchClass.
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   154
            ].
16414
718569261384 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 15188
diff changeset
   155
        ].
8657
1df84e8daa15 care for nil suspendedContext in description
penk
parents: 8501
diff changeset
   156
    ].
24592
b003befd8100 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 24111
diff changeset
   157
    rcvr := self receiver.
18302
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   158
    searchClass isNil ifTrue:[
24592
b003befd8100 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 24111
diff changeset
   159
        searchClass := rcvr class.
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   160
    ].
24592
b003befd8100 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 24111
diff changeset
   161
18302
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   162
    searchClass notNil ifTrue:[
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   163
        "displayString is better than 'cls name',
22522
17b213494d2a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20447
diff changeset
   164
         since it appends (obsolete) for outdated classes
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   165
         (this happens if you send messages to old instances
22522
17b213494d2a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20447
diff changeset
   166
          after changing a classes definition),
17b213494d2a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20447
diff changeset
   167
         and may be also redefined for non-Smalltalk object (i.e. BridgeObjects)"
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   168
24592
b003befd8100 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 24111
diff changeset
   169
        searchClass == rcvr class ifTrue:[
b003befd8100 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 24111
diff changeset
   170
            description := rcvr classDisplayString.
22524
be41e4a8c1aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22522
diff changeset
   171
        ] ifFalse:[
be41e4a8c1aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22522
diff changeset
   172
            description := searchClass displayString.
be41e4a8c1aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22522
diff changeset
   173
        ].
10446
21f13f605ff5 changed #description - take care if the classes displayString is not a String
Stefan Vogel <sv@exept.de>
parents: 8657
diff changeset
   174
        description isString ifFalse:[
21f13f605ff5 changed #description - take care if the classes displayString is not a String
Stefan Vogel <sv@exept.de>
parents: 8657
diff changeset
   175
            description := '(** ???-class **)'
21f13f605ff5 changed #description - take care if the classes displayString is not a String
Stefan Vogel <sv@exept.de>
parents: 8657
diff changeset
   176
        ].
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   177
    ] ifFalse:[    
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   178
        description := '(** nil-class **)'
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   179
    ].
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   180
    sel := self selector.
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   181
    sel class == Symbol ifTrue:[
24592
b003befd8100 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 24111
diff changeset
   182
        rcvr isNil ifTrue:[
23656
e7b73c09e3d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23286
diff changeset
   183
            description := 'receiver of "',sel printString,'" is nil'.
24592
b003befd8100 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 24111
diff changeset
   184
        ] ifFalse:[
b003befd8100 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 24111
diff changeset
   185
            (searchClass notNil and:[rcvr isBridgeProxy not and:[searchClass programmingLanguage isSmalltalk]]) ifTrue:[
24111
2c17f738ce20 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24110
diff changeset
   186
                description := description , ' does not understand: "',sel,'"'.
2c17f738ce20 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24110
diff changeset
   187
                "/ description := sel, ' not understood by ' ,  description.
2c17f738ce20 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24110
diff changeset
   188
            ] ifFalse:[ 
2c17f738ce20 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24110
diff changeset
   189
                description := description , ' does not implement: ' , sel.
2c17f738ce20 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24110
diff changeset
   190
            ].
23169
012958580544 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22524
diff changeset
   191
        ].
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   192
    ] ifFalse:[
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   193
        "a non-symbol selector may happen when things go mad in a primitive, 
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   194
         or a method has been called by #perform: or #valueWithReceiver: with a wrong arg."
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   195
22522
17b213494d2a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20447
diff changeset
   196
        "/ assume that it might be ok with other prog. languages
24592
b003befd8100 #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 24111
diff changeset
   197
        (searchClass notNil and:[rcvr isBridgeProxy not and:[searchClass programmingLanguage isSmalltalk]]) ifTrue:[
23286
12a32821f2f1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23169
diff changeset
   198
            description := description , ' does not understand (nonSymbol): ' , sel printString.
22522
17b213494d2a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20447
diff changeset
   199
            "/ description := sel printString, ' (nonSymbol) not understood by ' ,  description.
22524
be41e4a8c1aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22522
diff changeset
   200
        ] ifFalse:[
be41e4a8c1aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22522
diff changeset
   201
            description := description , ' does not implement: ' , sel printString.
22522
17b213494d2a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20447
diff changeset
   202
        ].
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   203
    ].
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   204
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   205
    ^ description
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   206
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   207
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   208
    "
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   209
        2 foo:3
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   210
        2 perform:55
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   211
        nil // 2
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   212
    "
13028
2fdfcae3cf1d changed: #description
Claus Gittinger <cg@exept.de>
parents: 10446
diff changeset
   213
2fdfcae3cf1d changed: #description
Claus Gittinger <cg@exept.de>
parents: 10446
diff changeset
   214
    "Modified: / 19-08-2010 / 15:33:03 / cg"
24110
ffabe63bb793 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 23887
diff changeset
   215
    "Modified: / 07-05-2019 / 17:31:24 / Stefan Vogel"
24111
2c17f738ce20 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24110
diff changeset
   216
    "Modified: / 08-05-2019 / 00:52:54 / Claus Gittinger"
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   217
! !
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   218
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
!MessageNotUnderstood class methodsFor:'documentation'!
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
version
20447
4b8519e42c13 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18302
diff changeset
   222
    ^ '$Header$'
13028
2fdfcae3cf1d changed: #description
Claus Gittinger <cg@exept.de>
parents: 10446
diff changeset
   223
!
2fdfcae3cf1d changed: #description
Claus Gittinger <cg@exept.de>
parents: 10446
diff changeset
   224
2fdfcae3cf1d changed: #description
Claus Gittinger <cg@exept.de>
parents: 10446
diff changeset
   225
version_CVS
20447
4b8519e42c13 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18302
diff changeset
   226
    ^ '$Header$'
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
! !
15188
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
   228
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
   229
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
   230
MessageNotUnderstood initialize!