mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
feat: add HTTPExceptionInterface and ExitExceptionInterface
This commit is contained in:
parent
5901d10c29
commit
f313732eb5
@ -11,9 +11,10 @@
|
||||
|
||||
namespace CodeIgniter\Database\Exceptions;
|
||||
|
||||
use CodeIgniter\Exceptions\HasExitCodeException;
|
||||
use Error;
|
||||
|
||||
class DatabaseException extends Error implements ExceptionInterface
|
||||
class DatabaseException extends Error implements ExceptionInterface, HasExitCodeException
|
||||
{
|
||||
/**
|
||||
* Exit status code
|
||||
|
@ -18,7 +18,7 @@ namespace CodeIgniter\Exceptions;
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
class CastException extends CriticalError
|
||||
class CastException extends CriticalError implements HasExitCodeException
|
||||
{
|
||||
use DebugTraceableTrait;
|
||||
|
||||
|
@ -14,7 +14,7 @@ namespace CodeIgniter\Exceptions;
|
||||
/**
|
||||
* Exception for automatic logging.
|
||||
*/
|
||||
class ConfigException extends CriticalError
|
||||
class ConfigException extends CriticalError implements HasExitCodeException
|
||||
{
|
||||
use DebugTraceableTrait;
|
||||
|
||||
|
19
system/Exceptions/ExitExceptionInterface.php
Normal file
19
system/Exceptions/ExitExceptionInterface.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of CodeIgniter 4 framework.
|
||||
*
|
||||
* (c) CodeIgniter Foundation <admin@codeigniter.com>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CodeIgniter\Exceptions;
|
||||
|
||||
/**
|
||||
* Interface for Exceptions that has exception code as exit code.
|
||||
*/
|
||||
interface ExitExceptionInterface
|
||||
{
|
||||
}
|
19
system/Exceptions/HTTPExceptionInterface.php
Normal file
19
system/Exceptions/HTTPExceptionInterface.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of CodeIgniter 4 framework.
|
||||
*
|
||||
* (c) CodeIgniter Foundation <admin@codeigniter.com>
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace CodeIgniter\Exceptions;
|
||||
|
||||
/**
|
||||
* Interface for Exceptions that has exception code as HTTP status code.
|
||||
*/
|
||||
interface HTTPExceptionInterface
|
||||
{
|
||||
}
|
@ -14,7 +14,7 @@ namespace CodeIgniter\Exceptions;
|
||||
use Config\Services;
|
||||
use OutOfBoundsException;
|
||||
|
||||
class PageNotFoundException extends OutOfBoundsException implements ExceptionInterface
|
||||
class PageNotFoundException extends OutOfBoundsException implements ExceptionInterface, HasHttpStatusCodeException
|
||||
{
|
||||
use DebugTraceableTrait;
|
||||
|
||||
|
@ -11,12 +11,13 @@
|
||||
|
||||
namespace CodeIgniter\Router\Exceptions;
|
||||
|
||||
use CodeIgniter\Exceptions\HasHttpStatusCodeException;
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* RedirectException
|
||||
*/
|
||||
class RedirectException extends Exception
|
||||
class RedirectException extends Exception implements HasHttpStatusCodeException
|
||||
{
|
||||
/**
|
||||
* HTTP status code for redirects
|
||||
|
Loading…
x
Reference in New Issue
Block a user