MessageNotUnderstood.st
author Claus Gittinger <cg@exept.de>
Wed, 10 Apr 2019 09:31:03 +0200
changeset 24051 f531b38415db
parent 23887 690af9f439a5
child 24110 ffabe63bb793
permissions -rw-r--r--
struct args
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
23887
690af9f439a5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23656
diff changeset
     1
"{ Encoding: utf8 }"
690af9f439a5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23656
diff changeset
     2
7586
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
     3
"
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
     4
 COPYRIGHT (c) 2001 by eXept Software AG
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
     5
              All Rights Reserved
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
     6
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
     7
 This software is furnished under a license and may be used
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
     8
 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
     9
 inclusion of the above copyright notice.   This software may not
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    10
 be provided or otherwise made available to, or used by, any
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    11
 other person.  No title to or ownership of the software is
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    12
 hereby transferred.
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    13
"
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
"{ Package: 'stx:libbasic' }"
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
18290
5ea0b888d79d class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 16414
diff changeset
    16
"{ NameSpace: Smalltalk }"
5ea0b888d79d class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 16414
diff changeset
    17
20447
4b8519e42c13 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18302
diff changeset
    18
ExecutionError subclass:#MessageNotUnderstood
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
	instanceVariableNames:''
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
	classVariableNames:''
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
	poolDictionaries:''
6210
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    22
	category:'Kernel-Exceptions-Errors'
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
!
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
6210
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    25
!MessageNotUnderstood class methodsFor:'documentation'!
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    26
7586
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    27
copyright
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
 COPYRIGHT (c) 2001 by eXept Software AG
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    30
              All Rights Reserved
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    31
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    32
 This software is furnished under a license and may be used
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    33
 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
    34
 inclusion of the above copyright notice.   This software may not
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    35
 be provided or otherwise made available to, or used by, any
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    36
 other person.  No title to or ownership of the software is
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    37
 hereby transferred.
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    38
"
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    39
!
63e4900c8931 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 6669
diff changeset
    40
6210
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    41
documentation
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    42
"
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    43
    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
    44
    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
    45
    doesNotUnderstand: handler.
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    46
"
d7039e2ae776 caetgory change and documentation added
Claus Gittinger <cg@exept.de>
parents: 5982
diff changeset
    47
! !
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
15188
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
    49
!MessageNotUnderstood class methodsFor:'initialization'!
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
    50
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
    51
initialize
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
    52
    NotifierString := 'message not understood'.
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
    53
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
     self initialize
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
    56
    "
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
    57
! !
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
    58
6667
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    59
!MessageNotUnderstood class methodsFor:'save evaluation'!
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    60
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    61
ignoreNotUnderstoodOf:aSelector in:aBlock
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    62
    "evaluate aBlock; if a messageNotUnderstood occurs,
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    63
     for which the message was aSelector, ignore the error
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    64
     and return.
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    65
     Other selector errors lead into the debugger.
23887
690af9f439a5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23656
diff changeset
    66
     If no error occurs, return the block's value"
6667
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    67
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    68
    ^ self handle:[:ex |
6669
992abad6f5aa *** empty log message ***
ca
parents: 6668
diff changeset
    69
        ex selector == aSelector ifFalse:[
6667
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    70
            ex reject
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    71
        ]
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    72
    ] do:aBlock.
23887
690af9f439a5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23656
diff changeset
    73
690af9f439a5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23656
diff changeset
    74
    "Modified (comment): / 13-03-2019 / 10:26:10 / Claus Gittinger"
6668
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    75
!
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    76
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    77
ignoreNotUnderstoodOfAny:aCollectionOfSelectors in:aBlock
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    78
    "evaluate aBlock; if a messageNotUnderstood occurs,
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    79
     for which the message was any in aCollectionOfSelectors, ignore the error
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    80
     and return.
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    81
     Other selector errors lead into the debugger.
23887
690af9f439a5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23656
diff changeset
    82
     If no error occurs, return the block's value"
6668
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    83
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    84
    ^ self handle:[:ex |
6669
992abad6f5aa *** empty log message ***
ca
parents: 6668
diff changeset
    85
        (aCollectionOfSelectors includesIdentical:ex selector) ifFalse:[
6668
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    86
            ex reject
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    87
        ]
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
    88
    ] do:aBlock.
23887
690af9f439a5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23656
diff changeset
    89
690af9f439a5 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 23656
diff changeset
    90
    "Modified (comment): / 13-03-2019 / 10:26:14 / Claus Gittinger"
6667
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    91
! !
cd760a230e58 *** empty log message ***
ca
parents: 6210
diff changeset
    92
5982
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    93
!MessageNotUnderstood methodsFor:'accessing'!
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    94
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    95
message
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
    96
    ^ parameter
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
        123 perform:#foo
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   101
     ] on:MessageNotUnderstood do:[:ex |
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   102
        Transcript show:'message object: '; showCR:ex message storeString.
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   103
        Transcript show:'receiver: '; showCR:ex receiver storeString.
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   104
        Transcript show:'selector: '; showCR:ex message selector storeString.
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   105
        Transcript show:'arguments: '; showCR:ex message arguments storeString.
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
!
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
receiver
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   111
    ^ originator
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
    "
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   114
     [
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   115
        123 perform:#foo
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   116
     ] on:MessageNotUnderstood do:[:ex |
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   117
        Transcript showCR:ex receiver
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   118
     ]
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   119
    "
6668
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   120
!
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   121
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   122
selector
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   123
    ^ parameter selector
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   124
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   125
    "
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   126
     [
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   127
        123 perform:#foo
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   128
     ] on:MessageNotUnderstood do:[:ex |
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   129
        Transcript show:'selector: '; showCR:ex selector storeString.
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   130
     ]
f2489cb96530 *** empty log message ***
ca
parents: 6667
diff changeset
   131
    "
5982
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   132
! !
2965b58b4258 ANSI accessors
Claus Gittinger <cg@exept.de>
parents: 5976
diff changeset
   133
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   134
!MessageNotUnderstood methodsFor:'printing & storing'!
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   135
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   136
description
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   137
    "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
   138
18302
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   139
    |searchClass sel description sender|
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   140
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   141
    "extract the class that should have implemented the message.
16414
718569261384 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 15188
diff changeset
   142
     (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
   143
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   144
    "/ suspendedContext is the actual doesNotUnderstand context;
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   145
    "/ 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
   146
    "/ (the doesNotUnderstand is always an undirected send)
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   147
    "/ Q: is that correct VM-behavior?
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   148
    "/ One might argue, that the DNU should be also directed 
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   149
    "/ (or else add the searchClass information to the Message object)
8657
1df84e8daa15 care for nil suspendedContext in description
penk
parents: 8501
diff changeset
   150
    suspendedContext notNil ifTrue:[
18302
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   151
        searchClass := suspendedContext searchClass.
18290
5ea0b888d79d class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 16414
diff changeset
   152
        (sender := suspendedContext sender) notNil ifTrue:[
18302
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   153
            "/ just in case, this gets ever fixed
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   154
            sender receiver == suspendedContext receiver ifTrue:[
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   155
                searchClass := sender searchClass.
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   156
            ].
16414
718569261384 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 15188
diff changeset
   157
        ].
8657
1df84e8daa15 care for nil suspendedContext in description
penk
parents: 8501
diff changeset
   158
    ].
18302
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   159
    searchClass isNil ifTrue:[
67840a4affd1 class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 18290
diff changeset
   160
        searchClass := self receiver class.
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
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
22524
be41e4a8c1aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22522
diff changeset
   169
        searchClass == self receiver class ifTrue:[
be41e4a8c1aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22522
diff changeset
   170
            description := self receiver classDisplayString.
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:[
23169
012958580544 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22524
diff changeset
   182
        self receiver 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'.
23169
012958580544 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22524
diff changeset
   184
        ] ifFalse:[    
012958580544 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22524
diff changeset
   185
            description := description , ' does not understand: "',sel,'"'.
012958580544 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22524
diff changeset
   186
            "/ description := sel, ' not understood by ' ,  description.
012958580544 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22524
diff changeset
   187
        ].
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   188
    ] ifFalse:[
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   189
        "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
   190
         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
   191
22522
17b213494d2a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20447
diff changeset
   192
        "/ assume that it might be ok with other prog. languages
17b213494d2a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20447
diff changeset
   193
        (searchClass notNil and:[ searchClass programmingLanguage isSmalltalk ]) ifTrue:[
23286
12a32821f2f1 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23169
diff changeset
   194
            description := description , ' does not understand (nonSymbol): ' , sel printString.
22522
17b213494d2a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20447
diff changeset
   195
            "/ description := sel printString, ' (nonSymbol) not understood by ' ,  description.
22524
be41e4a8c1aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22522
diff changeset
   196
        ] ifFalse:[
be41e4a8c1aa #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 22522
diff changeset
   197
            description := description , ' does not implement: ' , sel printString.
22522
17b213494d2a #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 20447
diff changeset
   198
        ].
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   199
    ].
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   200
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   201
    ^ description
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
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
        2 foo:3
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   206
        2 perform:55
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   207
        nil // 2
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   208
    "
13028
2fdfcae3cf1d changed: #description
Claus Gittinger <cg@exept.de>
parents: 10446
diff changeset
   209
2fdfcae3cf1d changed: #description
Claus Gittinger <cg@exept.de>
parents: 10446
diff changeset
   210
    "Modified: / 19-08-2010 / 15:33:03 / cg"
23656
e7b73c09e3d5 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 23286
diff changeset
   211
    "Modified: / 01-02-2019 / 00:34:48 / Claus Gittinger"
8501
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   212
! !
8e114640aa5c Speed up MessageNotUnderstood exception sending by layz computation
Stefan Vogel <sv@exept.de>
parents: 7586
diff changeset
   213
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
!MessageNotUnderstood class methodsFor:'documentation'!
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
version
20447
4b8519e42c13 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18302
diff changeset
   217
    ^ '$Header$'
13028
2fdfcae3cf1d changed: #description
Claus Gittinger <cg@exept.de>
parents: 10446
diff changeset
   218
!
2fdfcae3cf1d changed: #description
Claus Gittinger <cg@exept.de>
parents: 10446
diff changeset
   219
2fdfcae3cf1d changed: #description
Claus Gittinger <cg@exept.de>
parents: 10446
diff changeset
   220
version_CVS
20447
4b8519e42c13 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 18302
diff changeset
   221
    ^ '$Header$'
5976
4596197c1e0d initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
! !
15188
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
   223
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
   224
e1937381139c class: MessageNotUnderstood
Claus Gittinger <cg@exept.de>
parents: 13028
diff changeset
   225
MessageNotUnderstood initialize!