Skip to content

Instantly share code, notes, and snippets.

@KamilaBorowska
Created October 2, 2012 19:58
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 KamilaBorowska/3822919 to your computer and use it in GitHub Desktop.
Save KamilaBorowska/3822919 to your computer and use it in GitHub Desktop.
glitchmr@feather ~> perl6-debug -e '
sub get-coffee {
fail "Not enough coffee. Try your luck next time.";
}
my $coffee = get-coffee;
say "Checking the coffee...";
say " This coffee contains sugar: {+$coffee}.";
'
>>> LOADING -e
+ -e (3 - 7)
| fail "Not enough coffee. Try your luck next time.";
| }
| my $coffee = get-coffee;
| say "Checking the coffee...";
| say " This coffee contains sugar: {+$coffee}.";
>
+ -e (1 - 5)
|
| sub get-coffee {
| fail "Not enough coffee. Try your luck next time.";
| }
| my $coffee = get-coffee;
>
+ Exception Thrown
| Not enough coffee. Try your luck next time.
+ -e (1 - 5)
|
| sub get-coffee {
| fail "Not enough coffee. Try your luck next time.";
| }
| my $coffee = get-coffee;
>
+ -e (4 - 7)
| }
| my $coffee = get-coffee;
| say "Checking the coffee...";
| say " This coffee contains sugar: {+$coffee}.";
> $coffee
Failure.new(exception => X::AdHoc.new(payload => "Not enough coffee. Try your luck next time."))
>
Checking the coffee...
+ -e (5 - 7)
| my $coffee = get-coffee;
| say "Checking the coffee...";
| say " This coffee contains sugar: {+$coffee}.";
>
+ -e (5 - 7)
| my $coffee = get-coffee;
| say "Checking the coffee...";
| say " This coffee contains sugar: {+$coffee}.";
>
+ Uncaught Exception
| Not enough coffee. Try your luck next time.
+ -e (5 - 7)
| my $coffee = get-coffee;
| say "Checking the coffee...";
| say " This coffee contains sugar: {+$coffee}.";
>
Cannot continue execution after an unhandled exception
> q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment