Skip to content

Commit

Permalink
node control: make nicer error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed Jan 30, 2025
1 parent ec0f139 commit cf2f5fc
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1442,6 +1442,18 @@ sub _die_connection_error {
die($http_err);
}

if(($http_err//'') =~ m/\Qinternal error: admin privileges required\E/mx) {
$http_err = "admin privileges required\n".$http_err;
die($http_err."\nssh failed: ".$ssh_err) if $ssh_err;
die($http_err);
}

if(($http_err//'') =~ m/\Q403: Forbidden\E/mx) {
$http_err = "403: Forbidden\n".$http_err;
die($http_err."\nssh failed: ".$ssh_err) if $ssh_err;
die($http_err);
}

die("http(s) and ssh connection failed\nhttp(s):\n".$http_err."\n\nssh:\n".$ssh_err) if($http_err && $ssh_err);
die("http(s) connection failed\n".$http_err) if $http_err;
die("ssh connection failed\n".$ssh_err) if $ssh_err;
Expand Down

0 comments on commit cf2f5fc

Please sign in to comment.