Skip to content

Instantly share code, notes, and snippets.

@Tux
Created May 10, 2015 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tux/fceeab1d62fc77c00382 to your computer and use it in GitHub Desktop.
Save Tux/fceeab1d62fc77c00382 to your computer and use it in GitHub Desktop.
use v6;
use Test;
class C {
class E is Iterable does Positional is Exception {
has Int $.error = 0;
has Str $.message = "Error";
method sink {
"$!error: $!message".say;
}
}
method foo {
fail E.new;
}
}
my $e;
{ C.new.foo;
CATCH { default { $e = $_; }}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment