Cake\Console\Shell::error PHP Method

error() public method

Displays a formatted error message and exits the application with status code 1
Deprecation: 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.
return 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;
    }