X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FNetwork%2FHTTPException.php;h=b6be886b35f25bf396110610cb16c776251f8fa8;hb=61c1c1f53085c3d1edee2dbf5ecb08bbb5f2dd39;hp=b9bad457da13b0dbd17b45b7145abc1c12597197;hpb=5c1fae25368c41aef9a8a18ccda27fc35b0b9318;p=friendica.git diff --git a/src/Network/HTTPException.php b/src/Network/HTTPException.php index b9bad457da..b6be886b35 100644 --- a/src/Network/HTTPException.php +++ b/src/Network/HTTPException.php @@ -1,27 +1,45 @@ . * - * This list of Exception has be extracted from - * here http://racksburg.com/choosing-an-http-status-code/ */ namespace Friendica\Network; use Exception; -class HTTPException extends Exception +/** + * Throwable exceptions to return HTTP status code + * + * This list of Exception has been extracted from + * here http://racksburg.com/choosing-an-http-status-code/ + */ +abstract class HTTPException extends Exception { - var $httpcode = 200; - var $httpdesc = ""; + public $httpdesc = ''; - public function __construct($message = '', $code = 0, Exception $previous = null) + public function __construct($message = '', Exception $previous = null) { - if ($this->httpdesc == '') { + parent::__construct($message, $this->code, $previous); + + if (empty($this->httpdesc)) { $classname = str_replace('Exception', '', str_replace('Friendica\Network\HTTPException\\', '', get_class($this))); $this->httpdesc = preg_replace("|([a-z])([A-Z])|",'$1 $2', $classname); } - parent::__construct($message, $code, $previous); } }