https://www.fi.muni.cz/~kas/git
/
aoc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
41ea2c1
)
Task.pm: ignore die() inside eval
author
Jan "Yenya" Kasprzak
<kas@fi.muni.cz>
Sat, 7 Dec 2024 05:26:04 +0000
(06:26 +0100)
committer
Jan "Yenya" Kasprzak
<kas@fi.muni.cz>
Sat, 7 Dec 2024 05:26:04 +0000
(06:26 +0100)
lib/Y/AoC/Task.pm
patch
|
blob
|
history
diff --git
a/lib/Y/AoC/Task.pm
b/lib/Y/AoC/Task.pm
index cc1cdddd08a8346c21983d7ef79d268c6b55260b..0da7d2954ac540ecfa7818a9e36f7215021fef6f 100644
(file)
--- a/
lib/Y/AoC/Task.pm
+++ b/
lib/Y/AoC/Task.pm
@@
-10,6
+10,9
@@
use Y::AoC qw(red white grey yellow day year);
our $printed_err;
$SIG{__DIE__} = sub($msg) {
+ if ($^S) {
+ die $@; # just rethrow
+ }
$msg =~ s/\A(.*?)( at \S+ )(line \d+)/red($1).$2.white($3)/e
if -t STDERR && !$printed_err++;
say STDERR $msg;
@@
-29,6
+32,7
@@
our $in_test;
sub t($subtest = ()) {
$subtest //= '';
$ARGV[0] =~ s/in\.txt/test$subtest.txt/ if defined $ARGV[0];
+ say STDERR grey("Test mode. Using "), white($ARGV[0]), grey(" instead.");
$in_test = 1;
}