| Total Complexity | 6 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class GSyncException extends Exception { |
||
| 11 | protected $defaultLogLevel = LOGLEVEL_FATAL; |
||
| 12 | protected $httpReturnCode = HTTP_CODE_500; |
||
| 13 | protected $httpReturnMessage = "Internal Server Error"; |
||
| 14 | protected $httpHeaders = []; |
||
| 15 | protected $showLegal = true; |
||
| 16 | |||
| 17 | public function __construct($message = "", $code = 0, $previous = null, $logLevel = false) { |
||
| 18 | if (!$message) { |
||
| 19 | $message = $this->httpReturnMessage; |
||
| 20 | } |
||
| 21 | |||
| 22 | if (!$logLevel) { |
||
| 23 | $logLevel = $this->defaultLogLevel; |
||
| 24 | } |
||
| 25 | |||
| 26 | parent::__construct($message, (int) $code); |
||
| 27 | SLog::Write($logLevel, get_class($this) . ': ' . $message . ' - code: ' . $code . ' - file: ' . $this->getFile() . ':' . $this->getLine(), false); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function getHTTPCodeString() { |
||
| 31 | return $this->httpReturnCode . " " . $this->httpReturnMessage; |
||
| 32 | } |
||
| 33 | |||
| 34 | public function getHTTPHeaders() { |
||
| 35 | return $this->httpHeaders; |
||
| 36 | } |
||
| 37 | |||
| 38 | public function showLegalNotice() { |
||
| 40 | } |
||
| 41 | } |
||
| 42 |