$ob_level
$ob_level : integer
Nesting level of the output buffering mechanism
继承异常类,用于Services.php
$config : \Config\Exceptions
Config for debug exceptions.
$request : \CodeIgniter\HTTP\IncomingRequest
The incoming request.
$response : \CodeIgniter\HTTP\Response
The outgoing response.
__construct(\Config\Exceptions $config, \CodeIgniter\HTTP\IncomingRequest $request, \CodeIgniter\HTTP\Response $response)
Constructor.
\Config\Exceptions | $config | |
\CodeIgniter\HTTP\IncomingRequest | $request | |
\CodeIgniter\HTTP\Response | $response |
errorHandler(integer $severity, string $message, string|null $file = null, integer|null $line = null, null $context = null)
排除部分错误提示
This seems to be primarily when a user triggers it with trigger_error().
integer | $severity | |
string | $message | |
string|null | $file | |
integer|null | $line | |
null | $context |
respond(array|string|null $data = null, integer $status = null, string $message = '') : mixed
Provides a single, simple method to return an API response, formatted to match the requested format, with proper content-type and status code.
array|string|null | $data | |
integer | $status | |
string | $message |
fail(string|array $messages, integer|null $status = 400, string|null $code = null, string $customMessage = '') : mixed
Used for generic failures that no custom methods exist for.
string|array | $messages | |
integer|null | $status | HTTP status code |
string|null | $code | Custom, API-specific, error code |
string | $customMessage |
failUnauthorized(string $description = 'Unauthorized', string $code = null, string $message = '') : mixed
Used when the client is either didn't send authorization information, or had bad authorization credentials. User is encouraged to try again with the proper information.
string | $description | |
string | $code | |
string | $message |
failResourceGone(string $description = 'Gone', string $code = null, string $message = '') : mixed
Use when a resource was previously deleted. This is different than Not Found, because here we know the data previously existed, but is now gone, where Not Found means we simply cannot find any information about it.
string | $description | |
string | $code | |
string | $message |
failServerError(string $description = 'Internal Server Error', string|null $code = null, string $message = '') : \CodeIgniter\HTTP\Response
Used when there is a server error.
string | $description | The error message to show the user. |
string|null | $code | A custom, API-specific, error code. |
string | $message | A custom "reason" message to return. |
The value of the Response's send() method.
determineView(\Throwable $exception, string $template_path) : string
Determines the view to display based on the exception thrown, whether an HTTP or CLI request, etc.
\Throwable | $exception | |
string | $template_path |
The path and filename of the view file to use