Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #626 from cygx/open-fail
make IO::Handle.open fail when nqp::open dies
  • Loading branch information
lizmat committed Dec 8, 2015
2 parents 9476601 + fbba428 commit d3e89a5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/core/IO/Handle.pm
Expand Up @@ -94,11 +94,13 @@ my class IO::Handle does IO {
$truncate ?? 't' !! '',
$exclusive ?? 'x' !! '';

# TODO: catch error, and fail()
$!PIO := nqp::open(
nqp::unbox_s($!path.abspath),
nqp::unbox_s($llmode),
);
{
CATCH { .fail }
$!PIO := nqp::open(
nqp::unbox_s($!path.abspath),
nqp::unbox_s($llmode),
);
}

$!chomp = $chomp;
$!nl-out = $nl-out;
Expand Down

0 comments on commit d3e89a5

Please sign in to comment.