]> git.mxchange.org Git - friendica.git/blob - src/Network/HTTPException.php
Merge pull request #7988 from friendica/MrPetovan-notice
[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 been extracted from
7  * here http://racksburg.com/choosing-an-http-status-code/
8  */
9
10 namespace Friendica\Network;
11
12 use Exception;
13
14 abstract class HTTPException extends Exception
15 {
16         public $httpdesc = '';
17
18         public function __construct($message = '', Exception $previous = null)
19         {
20                 parent::__construct($message, $this->code, $previous);
21
22                 if (empty($this->httpdesc)) {
23                         $classname = str_replace('Exception', '', str_replace('Friendica\Network\HTTPException\\', '', get_class($this)));
24                         $this->httpdesc = preg_replace("|([a-z])([A-Z])|",'$1 $2', $classname);
25                 }
26         }
27 }