diff options
author | Raphael Manfredi <Raphael_Manfredi@pobox.com> | 2017-05-13 13:50:42 +0200 |
---|---|---|
committer | Raphael Manfredi <Raphael_Manfredi@pobox.com> | 2017-05-13 13:50:42 +0200 |
commit | e17476b806aad1f8da32470141419a79a9fe1a78 (patch) | |
tree | 06b15702ef9400f23cad5c95c420a4bb443feea2 /mcon/pl | |
parent | f86879f9a187c34ba729c895a7523714736250c2 (diff) |
process_command: be more explicit about errors when opening units.
Diffstat (limited to 'mcon/pl')
-rw-r--r-- | mcon/pl/configure.pl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/mcon/pl/configure.pl b/mcon/pl/configure.pl index a5aed29..d99d74b 100644 --- a/mcon/pl/configure.pl +++ b/mcon/pl/configure.pl @@ -77,7 +77,8 @@ sub process_command { warn "\t $msg\n"; } } - die "Can't open $file.\n" unless open(UNIT, $file); + die "Can't open $file.($name for target $target): $!\n" + unless open(UNIT, $file); print "\t$cmd $file\n" if $opt_v; &init_interp; # Initializes the interpreter @@ -215,9 +216,9 @@ sub process_command { elsif ($cmd eq 'prepend') { if (-s $file) { open(PREPEND, ">.prepend") || - die "Can't create .MT/.prepend.\n"; + die "Can't create .MT/.prepend: $!\n"; open(TARGET, $Unit{$target}) || - die "Can't open $Unit{$target}.\n"; + die "Can't open unit $Unit{$target}: $!\n"; while (<TARGET>) { print PREPEND unless &skipped; } @@ -225,7 +226,7 @@ sub process_command { close PREPEND; close TARGET; rename('.prepend', $file) || - die "Can't rename .prepend into $file.\n"; + die "Can't rename .prepend into $file: $!\n"; } } |