Created
October 2, 2012 19:58
-
-
Save KamilaBorowska/3822919 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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