Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Proc::Async: fix exception throwing
  • Loading branch information
moritz committed Jan 25, 2015
1 parent 6429a22 commit 7e8d8af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/Proc/Async.pm
Expand Up @@ -211,8 +211,8 @@ my class Proc::Async {
}

method print(Proc::Async:D: $str as Str, :$scheduler = $*SCHEDULER) {
X::Proc::Async::OpenForWriting(:method<print>).new.throw if !$!w;
X::Proc::Async::MustBeStarted(:method<print>).new.throw if !$!started;
X::Proc::Async::OpenForWriting.new(:method<print>).throw if !$!w;
X::Proc::Async::MustBeStarted.new(:method<print>).throw if !$!started;

my $p = Promise.new;
my $v = $p.vow;
Expand All @@ -232,8 +232,8 @@ my class Proc::Async {
}

method say(Proc::Async:D: $str as Str, |c) {
X::Proc::Async::OpenForWriting(:method<say>).new.throw if !$!w;
X::Proc::Async::MustBeStarted(:method<say>).new.throw if !$!started;
X::Proc::Async::OpenForWriting.new(:method<say>).throw if !$!w;
X::Proc::Async::MustBeStarted.new(:method<say>).throw if !$!started;

self.print( $str ~ "\n", |c );
}
Expand Down

0 comments on commit 7e8d8af

Please sign in to comment.