#783 Signal on User and Any fail to trap user conditions

v4.0beta
closed
Rick McGuire
5
2012-08-14
2009-08-08
Mark Gaubatz
No

4.0.0 RC 3 Ubuntu Linux 9.04

User conditions fail to trap. For example:

.test~new~Case1
.test~new~Case2
.test~new~Case3

::options trace I

::class test
::method Case1
signal on user grumpy
raise user grumpy
User: say "Generic worked"

::method Case2
signal on user programmer name programmer
raise user programmer
Programmer: say "Name worked"

::method Case3
signal on any
raise user headache
Any: say "Any worked"

Discussion

  • Mark Gaubatz
    Mark Gaubatz
    2009-08-08

    Addendum: SIGNAL/CALL ON USER name works from a higher level, just not within the same scope. That is, the following works:

    signal on user frustrated
    .test~new~Case
    say "Done"
    exit
    frustrated: say "Trapped here...; incorrectly propagated"

    ::class test
    ::method Case
    signal on user frustrated
    raise user frustrated
    frustrated: say "I actually worked and am not frustrated"

    ::class test
    ::method Case
    signal on user frustrated
    raise user frustrated
    frustrated: say "I actually worked and am not frustrated"

     
  • Rick McGuire
    Rick McGuire
    2009-08-08

    This is the way the RAISE instruction works. It ALWAYS terminates the current call/method level and raises the condition in the caller's context.

     


Anonymous


Cancel   Add attachments