X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FNetwork%2FHTTPException.php;h=f59ff547c9ba457770ce614ae1d1a04817687d9e;hb=37405567c1a71a805b722ae56604be7ee89251ab;hp=89c447b71470ecd302b86ae8f2f105c42c4969b2;hpb=8eba329111e832d7efdacf4f6a6fa85b0f7abbf3;p=friendica.git diff --git a/src/Network/HTTPException.php b/src/Network/HTTPException.php index 89c447b714..f59ff547c9 100644 --- a/src/Network/HTTPException.php +++ b/src/Network/HTTPException.php @@ -1,27 +1,51 @@ . * - * This list of Exception has been extracted from - * here http://racksburg.com/choosing-an-http-status-code/ */ namespace Friendica\Network; use 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 { - public $httpdesc = ''; + protected $httpdesc = ''; + protected $explanation = ''; public function __construct($message = '', Exception $previous = null) { 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); - } + public function getDescription() + { + return $this->httpdesc; + } + + public function getExplanation() + { + return $this->explanation; } }