develooper Front page | perl.perl6.users | Postings from February 2019

.payload

Thread Next
From:
ToddAndMargo via perl6-users
Date:
February 28, 2019 11:46
Subject:
.payload
Message ID:
a3be9b8c-1c15-3ddd-3484-e4bc74ae68ec@zoho.com
Hi All,

https://docs.perl6.org/language/exceptions#Catching_exceptions

I am trying to place .payload into a variable `my $Payload = .payload;`


CATCH {
    # Reference: 
https://docs.perl6.org/language/exceptions#Catching_exceptions
    my $NotifyStr;
    my $Payload = .payload;

    default {
       # $*ERR.say: .payload;
       PrintRedErr( "$Payload\n" );
       $NotifyStr = $Payload;
       for .backtrace.reverse {
          next if .file.starts-with('SETTING::');
          next unless .subname;
          # $*ERR.say: "  in block {.subname} at {.file} line {.line}";
          PrintRedErr( "  in block {.subname} at {.file} line {.line}\n" );
       }
    }
    RunNoShell( "notify-send -u critical -t 0 -i \"$AlarmJpg\" \"CATCH 
Trap \" \"$NotifyStr\"" );
}


But keep pulling the following error:

      No such method 'payload' for invocant of type
      'X::TypeCheck::Assignment' in block <unit>
      at ./GetUpdates.pl6 line 60

Line 60 is `my $Payload = .payload;`

What am I doing wrong?

Many thanks,
-T

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About