mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user