You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
504 B
24 lines
504 B
3 weeks ago
|
<?php
|
||
|
declare(strict_types = 1);
|
||
|
|
||
|
namespace App\Exceptions;
|
||
|
|
||
|
use Exception;
|
||
|
use Symfony\Component\HttpFoundation\Response;
|
||
|
|
||
|
class GeneralException extends Exception
|
||
|
{
|
||
|
protected int $status_code;
|
||
|
|
||
|
public function __construct(string $message = 'An error occurred.', int $status_code = Response::HTTP_BAD_REQUEST)
|
||
|
{
|
||
|
parent::__construct($message);
|
||
|
$this->status_code = $status_code;
|
||
|
}
|
||
|
|
||
|
public function getStatusCode(): int
|
||
|
{
|
||
|
return $this->status_code;
|
||
|
}
|
||
|
}
|