|
Apache/2.4.41 (Ubuntu) Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) server ip : 62.171.164.128 | your ip : 127.0.0.1 safemode OFF > / home / a / home / dev2.destoffenstraat.com / vendor / magento / framework / App / |
Filename | /home/a/home/dev2.destoffenstraat.com/vendor/magento/framework/App/ErrorHandler.php |
Size | 1.75 kb |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 21-Aug-2025 12:26 |
Last modified | 07-Jan-2021 21:08 |
Last accessed | 23-Aug-2025 00:37 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\App;
/**
* An error handler that converts runtime errors into exceptions
*/
class ErrorHandler
{
/**
* Error messages
*
* @var array
*/
protected $errorPhrases = [
E_ERROR => 'Error',
E_WARNING => 'Warning',
E_PARSE => 'Parse Error',
E_NOTICE => 'Notice',
E_CORE_ERROR => 'Core Error',
E_CORE_WARNING => 'Core Warning',
E_COMPILE_ERROR => 'Compile Error',
E_COMPILE_WARNING => 'Compile Warning',
E_USER_ERROR => 'User Error',
E_USER_WARNING => 'User Warning',
E_USER_NOTICE => 'User Notice',
E_STRICT => 'Strict Notice',
E_RECOVERABLE_ERROR => 'Recoverable Error',
E_DEPRECATED => 'Deprecated Functionality',
E_USER_DEPRECATED => 'User Deprecated Functionality',
];
/**
* Custom error handler
*
* @param int $errorNo
* @param string $errorStr
* @param string $errorFile
* @param int $errorLine
* @return bool
* @throws \Exception
*/
public function handler($errorNo, $errorStr, $errorFile, $errorLine)
{
if (strpos($errorStr, 'DateTimeZone::__construct') !== false) {
// there's no way to distinguish between caught system exceptions and warnings
return false;
}
$errorNo = $errorNo & error_reporting();
if ($errorNo == 0) {
return false;
}
$msg = isset($this->errorPhrases[$errorNo]) ? $this->errorPhrases[$errorNo] : "Unknown error ({$errorNo})";
$msg .= ": {$errorStr} in {$errorFile} on line {$errorLine}";
throw new \Exception($msg);
}
}
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\App;
/**
* An error handler that converts runtime errors into exceptions
*/
class ErrorHandler
{
/**
* Error messages
*
* @var array
*/
protected $errorPhrases = [
E_ERROR => 'Error',
E_WARNING => 'Warning',
E_PARSE => 'Parse Error',
E_NOTICE => 'Notice',
E_CORE_ERROR => 'Core Error',
E_CORE_WARNING => 'Core Warning',
E_COMPILE_ERROR => 'Compile Error',
E_COMPILE_WARNING => 'Compile Warning',
E_USER_ERROR => 'User Error',
E_USER_WARNING => 'User Warning',
E_USER_NOTICE => 'User Notice',
E_STRICT => 'Strict Notice',
E_RECOVERABLE_ERROR => 'Recoverable Error',
E_DEPRECATED => 'Deprecated Functionality',
E_USER_DEPRECATED => 'User Deprecated Functionality',
];
/**
* Custom error handler
*
* @param int $errorNo
* @param string $errorStr
* @param string $errorFile
* @param int $errorLine
* @return bool
* @throws \Exception
*/
public function handler($errorNo, $errorStr, $errorFile, $errorLine)
{
if (strpos($errorStr, 'DateTimeZone::__construct') !== false) {
// there's no way to distinguish between caught system exceptions and warnings
return false;
}
$errorNo = $errorNo & error_reporting();
if ($errorNo == 0) {
return false;
}
$msg = isset($this->errorPhrases[$errorNo]) ? $this->errorPhrases[$errorNo] : "Unknown error ({$errorNo})";
$msg .= ": {$errorStr} in {$errorFile} on line {$errorLine}";
throw new \Exception($msg);
}
}