Core/ErrorHandler

* do not handle errors outside of the registered handlers
 * always handle all errors otherwise they get stored for error_get_last
 * always print errors to CLI
 * shutdown function handler should not be picky about what errors it gets to report
 * removed some mostly unused error strings
This commit is contained in:
Sarjuuk
2024-06-24 16:50:10 +02:00
parent e614f415a9
commit 79764ced60
5 changed files with 52 additions and 68 deletions

View File

@@ -635,21 +635,22 @@ class CLISetup
{
if (Util::writeFile($file, $content))
{
CLI::write(sprintf(ERR_NONE, CLI::bold($file)), CLI::LOG_OK, true, true);
CLI::write('created file '. CLI::bold($file), CLI::LOG_OK, true, true);
return true;
}
$e = error_get_last();
CLI::write($e['message'].' '.CLI::bold($file), CLI::LOG_ERROR);
return false;
}
public static function writeDir(string $dir, bool &$exist = true) : bool
{
if (Util::writeDir($dir, $exist))
{
if (!$exist)
CLI::write('created dir '. CLI::bold($dir), CLI::LOG_OK, true, true);
return true;
}
CLI::write(error_get_last()['message'].' '.CLI::bold($dir), CLI::LOG_ERROR);
return false;
}