31 lines
598 B
PHP
31 lines
598 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Core\Exceptions;
|
|
|
|
use Exception;
|
|
|
|
class HttpException extends Exception
|
|
{
|
|
private string $errorCode;
|
|
private array $data;
|
|
|
|
public function __construct(string $message, string $errorCode = 'ERROR', int $statusCode = 500, array $data = [])
|
|
{
|
|
parent::__construct($message, $statusCode);
|
|
$this->errorCode = $errorCode;
|
|
$this->data = $data;
|
|
}
|
|
|
|
public function getErrorCode(): string
|
|
{
|
|
return $this->errorCode;
|
|
}
|
|
|
|
public function getData(): array
|
|
{
|
|
return $this->data;
|
|
}
|
|
}
|