N°3731 \DeprecatedCallsLog : always catch errors so that we won't crash the caller

This commit is contained in:
Pierre Goiffon
2021-04-13 16:43:26 +02:00
parent e5559a1899
commit a6d20ab648

View File

@@ -862,13 +862,17 @@ class DeprecatedCallsLog extends LogAPI
/**
* @param string|null $sAdditionalMessage
*
* @throws \ConfigException
* @link https://www.php.net/debug_backtrace
* @uses \debug_backtrace()
*/
public static function NotifyDeprecatedPhpMethod(?string $sAdditionalMessage = null): void
{
if (!static::IsLogLevelEnabled(self::LEVEL_WARNING, self::ENUM_CHANNEL_PHP_METHOD)) {
try {
if (!static::IsLogLevelEnabled(self::LEVEL_WARNING, self::ENUM_CHANNEL_PHP_METHOD)) {
return;
}
}
catch (ConfigException $e) {
return;
}
@@ -899,7 +903,12 @@ class DeprecatedCallsLog extends LogAPI
trigger_error($sMessage, E_USER_DEPRECATED);
}
parent::Log($sLevel, $sMessage, $sChannel, $aContext);
try {
parent::Log($sLevel, $sMessage, $sChannel, $aContext);
}
catch (ConfigException $e) {
// nothing much we can do... and we don't want to crash the caller !
}
}
}