1: | <?php |
2: | |
3: | namespace CHEZ14\ApiKit\Exceptions; |
4: | |
5: | use CodeIgniter\Exceptions\HTTPExceptionInterface; |
6: | use LogicException; |
7: | |
8: | class ApiException extends LogicException implements HTTPExceptionInterface |
9: | { |
10: | protected $httpCode = 500; |
11: | |
12: | |
13: | |
14: | |
15: | |
16: | |
17: | public function getHttpCode(): int |
18: | { |
19: | return $this->httpCode; |
20: | } |
21: | |
22: | |
23: | |
24: | |
25: | |
26: | |
27: | public function __construct(string $message, int $httpCode = 500, int $exceptionCode = 0) |
28: | { |
29: | parent::__construct($message, $exceptionCode); |
30: | $this->httpCode = $httpCode; |
31: | } |
32: | } |
33: | |