Skip to content

Commit 010e629

Browse files
committed
capture Windows error
1 parent c8f3d37 commit 010e629

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/Module/Release.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,11 +1359,12 @@ sub run {
13591359
waitpid( $pid, 0 );
13601360
my $child_exit_status = $? >> 8;
13611361

1362+
13621363
$self->_warn( $error ) if length $error;
13631364

13641365
if( $child_exit_status ) {
13651366
$self->_run_error_set;
1366-
$self->_warn( "Command [$command] didn't close cleanly: $?" );
1367+
$self->_warn( "Command [$command] didn't close cleanly: $child_exit_status" );
13671368
}
13681369

13691370
return $output;

t/run.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ subtest 'bad command' => sub {
6464
ok defined $at, "Bad command dies";
6565

6666
if( $^O eq 'MSWin32' ) {
67-
like $warnings, qr/'foo' is not recognized/, 'Saw Windows error';
67+
like $warnings, qr/didn't close cleanly/, 'Saw Windows error';
6868
}
6969
else {
7070
like $at, qr/exec of \Q$command\E failed/, "Error message with bad command";

0 commit comments

Comments
 (0)