Skip to content

Commit

Permalink
[backend] report network errors in getprojpack as "interconnect errors"
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Feb 19, 2013
1 parent 09d3d52 commit 687979e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/backend/bs_srcserver
Original file line number Diff line number Diff line change
Expand Up @@ -2430,7 +2430,14 @@ sub getprojpack {
if ($cgi->{'noremote'}) {
*BSRPC::rpc = sub {die("500 remote error: noremote option\n");};
} else {
*BSRPC::rpc = *oldbsrpc;
*BSRPC::rpc = sub {
my $r = eval { oldbsrpc(@_) };
if ($@) {
$@ = "interconnect error: $@" unless $@ =~ /(?:remote|interconnect) error:/;
die($@);
}
return $r;
};
}
$arch ||= 'noarch';
$projids = [ findprojects() ] unless $projids;
Expand Down

0 comments on commit 687979e

Please sign in to comment.