mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
net/haproxy: change to soft failure to avoid useless crash reports
This commit is contained in:
@@ -35,11 +35,11 @@ function socketCmd($command) {
|
||||
global $haproxy_socket;
|
||||
$data = array();
|
||||
if (!file_exists($haproxy_socket)) {
|
||||
throw new UnexpectedValueException("HAProxy socket does not exist, service may be stopped");
|
||||
exit("HAProxy socket does not exist, service may be stopped");
|
||||
} else {
|
||||
$socket = @stream_socket_client("unix://$haproxy_socket", $errorNumber, $errorMessage);
|
||||
if (!$socket) {
|
||||
throw new UnexpectedValueException("Unable to open socket: $errorMessage");
|
||||
exit("Unable to open socket: $errorMessage");
|
||||
} else {
|
||||
fwrite($socket, "$command\n");
|
||||
while (!feof($socket)) {
|
||||
|
||||
Reference in New Issue
Block a user