]> git.mxchange.org Git - friendica.git/blob - src/Network/HTTPException.php
eec4a9ced244ddc9a50b121eceaf2285d650f806
[friendica.git] / src / Network / HTTPException.php
1 <?php\r
2 \r
3 /**\r
4  * Throwable exceptions to return HTTP status code\r
5  *\r
6  * This list of Exception has be extracted from\r
7  * here http://racksburg.com/choosing-an-http-status-code/\r
8  */\r
9 \r
10 namespace Friendica\Network;\r
11 \r
12 use Exception;\r
13 \r
14 class HTTPException extends Exception {\r
15         var $httpcode = 200;\r
16         var $httpdesc = "";\r
17         public function __construct($message = "", $code = 0, Exception $previous = null) {\r
18                 if ($this->httpdesc == "") {\r
19                         $this->httpdesc = preg_replace("|([a-z])([A-Z])|",'$1 $2', str_replace("Exception","",get_class($this)));\r
20                 }\r
21                 parent::__construct($message, $code, $previous);\r
22         }\r
23 }\r