香洲二院小程序
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.
 
 
 
mini_xzey/app/Exceptions/GeneralException.php

23 lines
504 B

<?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;
}
}