]> git.mxchange.org Git - friendica.git/blob - src/Network/HTTPException.php
Bugfix for "Call to undefined function Friendica\Network\rsatopem()"
[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 {\r
16         var $httpcode = 200;\r
17         var $httpdesc = "";\r
18 \r
19         public function __construct($message = '', $code = 0, Exception $previous = null)\r
20         {\r
21                 if ($this->httpdesc == '') {\r
22                         $classname = str_replace('Exception', '', str_replace('Friendica\Network\HTTPException\\', '', get_class($this)));\r
23                         $this->httpdesc = preg_replace("|([a-z])([A-Z])|",'$1 $2', $classname);\r
24                 }\r
25                 parent::__construct($message, $code, $previous);\r
26         }\r
27 }\r