23 lines
548 B
PHP
23 lines
548 B
PHP
<?php
|
|
namespace nur\b;
|
|
|
|
use Throwable;
|
|
|
|
/**
|
|
* Class ExitException: une exception qui indique que l'application souhaite
|
|
* quitter normalement, avec éventuellement un code d'erreur.
|
|
*/
|
|
class ExitException extends UserException {
|
|
function __construct(int $exitcode=0, $message=null, Throwable $previous=null) {
|
|
parent::__construct($message, $exitcode, $previous);
|
|
}
|
|
|
|
function isError(): bool {
|
|
return $this->getCode() !== 0;
|
|
}
|
|
|
|
function haveMessage(): bool {
|
|
return $this->getUserMessage() || $this->getTechMessage();
|
|
}
|
|
}
|