Cake\Console\Shell::error PHP Метод

error() публичный Метод

Displays a formatted error message and exits the application with status code 1
Устаревший: Since 3.2.0. Use Shell::abort() instead.
public error ( string $title, string | null $message = null, integer $exitCode = self::CODE_ERROR ) : integer
$title string Title of the error
$message string | null An optional error message
$exitCode integer The exit code for the shell task.
Результат integer Error code
    public function error($title, $message = null, $exitCode = self::CODE_ERROR)
    {
        $this->_io->err(sprintf('<error>Error:</error> %s', $title));
        if (!empty($message)) {
            $this->_io->err($message);
        }
        $this->_stop($exitCode);
        return $exitCode;
    }