forked from kevinowino869/mitrobill
http error send to telegram
This commit is contained in:
parent
5baac9d7d0
commit
7585129522
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
|
||||
* by https://t.me/ibnux
|
||||
@ -37,9 +38,15 @@ class Http
|
||||
}
|
||||
curl_close($ch);
|
||||
if ($admin && $error_msg) {
|
||||
r2(U . 'dashboard', 'd', $error_msg);
|
||||
Message::sendTelegram(
|
||||
"Http::getData Error:\n" .
|
||||
_get('_route') . "\n" .
|
||||
"\n$url" .
|
||||
"\n$error_msg"
|
||||
);
|
||||
return $error_msg;
|
||||
}
|
||||
return ($server_output) ? $server_output : $error_msg;
|
||||
return (!empty($server_output)) ? $server_output : $error_msg;
|
||||
}
|
||||
|
||||
public static function postJsonData($url, $array_post, $headers = [], $basic = null)
|
||||
@ -73,9 +80,15 @@ class Http
|
||||
}
|
||||
curl_close($ch);
|
||||
if ($admin && $error_msg) {
|
||||
r2(U . 'dashboard', 'd', $error_msg);
|
||||
Message::sendTelegram(
|
||||
"Http::postJsonData:\n" .
|
||||
_get('_route') . "\n" .
|
||||
"\n$url" .
|
||||
"\n$error_msg"
|
||||
);
|
||||
return $error_msg;
|
||||
}
|
||||
return ($server_output) ? $server_output : $error_msg;
|
||||
return (!empty($server_output)) ? $server_output : $error_msg;
|
||||
}
|
||||
|
||||
|
||||
@ -110,8 +123,14 @@ class Http
|
||||
}
|
||||
curl_close($ch);
|
||||
if ($admin && $error_msg) {
|
||||
r2(U . 'dashboard', 'd', $error_msg);
|
||||
Message::sendTelegram(
|
||||
"Http::postData Error:\n" .
|
||||
_get('_route') . "\n" .
|
||||
"\n$url" .
|
||||
"\n$error_msg"
|
||||
);
|
||||
return $error_msg;
|
||||
}
|
||||
return ($server_output) ? $server_output : $error_msg;
|
||||
return (!empty($server_output)) ? $server_output : $error_msg;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user