From dc7d30cbf89572442ae06e111ff7f95f41833f47 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 22 Jul 2021 11:41:04 +0200 Subject: [PATCH] Stupid sexy error_get_last --- .../um_client/lib/UpdateManager/Client.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/pandora_console/godmode/um_client/lib/UpdateManager/Client.php b/pandora_console/godmode/um_client/lib/UpdateManager/Client.php index c20aa34fdc..3f76de4405 100644 --- a/pandora_console/godmode/um_client/lib/UpdateManager/Client.php +++ b/pandora_console/godmode/um_client/lib/UpdateManager/Client.php @@ -1340,19 +1340,16 @@ class Client error_reporting(E_ALL ^ E_NOTICE); set_error_handler( function ($errno, $errstr) { - if (preg_match('/Undefined index/i', $errstr) > 0) { - return; - } - throw new \Exception($errstr, $errno); - } + }, + E_ERROR ); register_shutdown_function( function () { $error = error_get_last(); if (null !== $error - && preg_match('/Undefined index/i', $error['message']) !== 1 + && $error['type'] === E_ERROR ) { echo __('Failed to analyze package: %s', $error['message']); } @@ -1435,12 +1432,9 @@ class Client error_reporting(E_ALL ^ E_NOTICE); set_error_handler( function ($errno, $errstr) { - if (preg_match('/Undefined index/i', $errstr) > 0) { - return; - } - throw new \Exception($errstr, $errno); - } + }, + E_ERROR ); if ($package === null) {