MessageNotUnderstood.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Jul 2019 20:55:17 +0200
changeset 24417 03b083548da2
parent 24111 2c17f738ce20
child 24592 b003befd8100
permissions -rw-r--r--
#REFACTORING by exept class: Smalltalk class changed: #recursiveInstallAutoloadedClassesFrom:rememberIn:maxLevels:noAutoload:packageTop:showSplashInLevels: Transcript showCR:(... bindWith:...) -> Transcript showCR:... with:...
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
18302
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   137
    |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
    ].
18302
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   157
    searchClass isNil ifTrue:[
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   158
        searchClass := self receiver class.
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   159
    ].
18302
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   160
    searchClass notNil ifTrue:[
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   161
        "displayString is better than 'cls name',
22522
17b213494d2a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20447
diff changeset
   162
         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
   163
         (this happens if you send messages to old instances
22522
17b213494d2a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20447
diff changeset
   164
          after changing a classes definition),
17b213494d2a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20447
diff changeset
   165
         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
   166
22524
be41e4a8c1aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22522
diff changeset
   167
        searchClass == self receiver class ifTrue:[
be41e4a8c1aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22522
diff changeset
   168
            description := self receiver classDisplayString.
be41e4a8c1aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22522
diff changeset
   169
        ] ifFalse:[
be41e4a8c1aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22522
diff changeset
   170
            description := searchClass displayString.
be41e4a8c1aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22522
diff changeset
   171
        ].
10446
21f13f605ff5 changed #description - take care if the classes displayString is not a String
Stefan Vogel <sv@exept.de>
parents: 8657
diff changeset
   172
        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
   173
            description := '(** ???-class **)'
21f13f605ff5 changed #description - take care if the classes displayString is not a String
Stefan Vogel <sv@exept.de>
parents: 8657
diff changeset
   174
        ].
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   175
    ] ifFalse:[    
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   176
        description := '(** nil-class **)'
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   177
    ].
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   178
    sel := self selector.
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   179
    sel class == Symbol ifTrue:[
23169
012958580544 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22524
diff changeset
   180
        self receiver isNil ifTrue:[
23656
e7b73c09e3d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23286
diff changeset
   181
            description := 'receiver of "',sel printString,'" is nil'.
23169
012958580544 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22524
diff changeset
   182
        ] ifFalse:[    
24111
2c17f738ce20 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24110
diff changeset
   183
            (searchClass notNil and:[self receiver isBridgeProxy not and:[searchClass programmingLanguage isSmalltalk]]) ifTrue:[
2c17f738ce20 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24110
diff changeset
   184
                description := description , ' does not understand: "',sel,'"'.
2c17f738ce20 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24110
diff changeset
   185
                "/ description := sel, ' not understood by ' ,  description.
2c17f738ce20 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24110
diff changeset
   186
            ] ifFalse:[ 
2c17f738ce20 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24110
diff changeset
   187
                description := description , ' does not implement: ' , sel.
2c17f738ce20 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24110
diff changeset
   188
            ].
23169
012958580544 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22524
diff changeset
   189
        ].
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   190
    ] ifFalse:[
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   191
        "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
   192
         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
   193
22522
17b213494d2a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20447
diff changeset
   194
        "/ assume that it might be ok with other prog. languages
24110
ffabe63bb793 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 23887
diff changeset
   195
        (searchClass notNil and:[self receiver isBridgeProxy not and:[searchClass programmingLanguage isSmalltalk]]) ifTrue:[
23286
12a32821f2f1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23169
diff changeset
   196
            description := description , ' does not understand (nonSymbol): ' , sel printString.
22522
17b213494d2a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20447
diff changeset
   197
            "/ description := sel printString, ' (nonSymbol) not understood by ' ,  description.
22524
be41e4a8c1aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22522
diff changeset
   198
        ] ifFalse:[
be41e4a8c1aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22522
diff changeset
   199
            description := description , ' does not implement: ' , sel printString.
22522
17b213494d2a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20447
diff changeset
   200
        ].
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   201
    ].
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   202
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   203
    ^ description
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
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
        2 foo:3
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   208
        2 perform:55
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   209
        nil // 2
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   210
    "
13028
2fdfcae3cf1d changed: #description
Claus Gittinger <cg@exept.de>
parents: 10446
diff changeset
   211
2fdfcae3cf1d changed: #description
Claus Gittinger <cg@exept.de>
parents: 10446
diff changeset
   212
    "Modified: / 19-08-2010 / 15:33:03 / cg"
24110
ffabe63bb793 #QUALITY by stefan
Stefan Vogel <sv@exept.de>
parents: 23887
diff changeset
   213
    "Modified: / 07-05-2019 / 17:31:24 / Stefan Vogel"
24111
2c17f738ce20 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 24110
diff changeset
   214
    "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
   215
! !
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   216
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
!MessageNotUnderstood class methodsFor:'documentation'!
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
version
20447
4b8519e42c13 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18302
diff changeset
   220
    ^ '$Header$'
13028
2fdfcae3cf1d changed: #description
Claus Gittinger <cg@exept.de>
parents: 10446
diff changeset
   221
!
2fdfcae3cf1d changed: #description
Claus Gittinger <cg@exept.de>
parents: 10446
diff changeset
   222
2fdfcae3cf1d changed: #description
Claus Gittinger <cg@exept.de>
parents: 10446
diff changeset
   223
version_CVS
20447
4b8519e42c13 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18302
diff changeset
   224
    ^ '$Header$'
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
! !
15188
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
   226
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
   227
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
   228
MessageNotUnderstood initialize!