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