Skip to content

Commit

Permalink
shorter error message
Browse files Browse the repository at this point in the history
Emit a short one-line error message for known problems (currently: no
healthy backends) instead of a full stacktrace.
  • Loading branch information
eserte committed Dec 30, 2024
1 parent c199050 commit c71f4ba
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/send_tr_reports.pl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Author: Slaven Rezic
#
# Copyright (C) 2008,2012,2013,2014,2015,2017,2018,2019 Slaven Rezic. All rights reserved.
# Copyright (C) 2008,2012,2013,2014,2015,2017,2018,2019,2024 Slaven Rezic. All rights reserved.
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
Expand Down Expand Up @@ -205,7 +205,15 @@
}

last DO_SEND if $r->send;
warn "[" . _ts . "] Something failed in $process_file: " . $r->errstr . ".\n";
my $errstr = $r->errstr;
if ($errstr =~ m{(
\Qfact submission failed: No healthy backends\E
)}x) {
# short error message
warn "[" . _ts . "] Failed for $process_file: $1\n";
} else {
warn "[" . _ts . "] Something failed in $process_file: " . $errstr . ".\n";
}
if ($try == $max_retry) {
die "Stop.\n";
}
Expand Down

0 comments on commit c71f4ba

Please sign in to comment.