This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccount/app/Exceptions/HTTPException.php
2019-04-24 18:46:41 +00:00

22 lines
No EOL
665 B
PHP

<?php
namespace App\Exceptions;
class HTTPException extends \Exception
{
// Die Exception neu definieren, damit die Mitteilung nicht optional ist
public function __construct($httpCode, $message, $code = 0, Exception $previous = null) {
// etwas Code
// sicherstellen, dass alles korrekt zugewiesen wird
parent::__construct($message, $code, $previous);
}
// maßgeschneiderte Stringdarstellung des Objektes
public function __toString() {
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
}
public function customFunction() {
echo "Eine eigene Funktion dieses Exceptiontyps\n";
}
}