mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 08:45:12 +02:00
Stupid sexy error_get_last
This commit is contained in:
parent
d3270904bd
commit
dc7d30cbf8
@ -1340,19 +1340,16 @@ class Client
|
|||||||
error_reporting(E_ALL ^ E_NOTICE);
|
error_reporting(E_ALL ^ E_NOTICE);
|
||||||
set_error_handler(
|
set_error_handler(
|
||||||
function ($errno, $errstr) {
|
function ($errno, $errstr) {
|
||||||
if (preg_match('/Undefined index/i', $errstr) > 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new \Exception($errstr, $errno);
|
throw new \Exception($errstr, $errno);
|
||||||
}
|
},
|
||||||
|
E_ERROR
|
||||||
);
|
);
|
||||||
|
|
||||||
register_shutdown_function(
|
register_shutdown_function(
|
||||||
function () {
|
function () {
|
||||||
$error = error_get_last();
|
$error = error_get_last();
|
||||||
if (null !== $error
|
if (null !== $error
|
||||||
&& preg_match('/Undefined index/i', $error['message']) !== 1
|
&& $error['type'] === E_ERROR
|
||||||
) {
|
) {
|
||||||
echo __('Failed to analyze package: %s', $error['message']);
|
echo __('Failed to analyze package: %s', $error['message']);
|
||||||
}
|
}
|
||||||
@ -1435,12 +1432,9 @@ class Client
|
|||||||
error_reporting(E_ALL ^ E_NOTICE);
|
error_reporting(E_ALL ^ E_NOTICE);
|
||||||
set_error_handler(
|
set_error_handler(
|
||||||
function ($errno, $errstr) {
|
function ($errno, $errstr) {
|
||||||
if (preg_match('/Undefined index/i', $errstr) > 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new \Exception($errstr, $errno);
|
throw new \Exception($errstr, $errno);
|
||||||
}
|
},
|
||||||
|
E_ERROR
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($package === null) {
|
if ($package === null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user