SystemException
This class represents a critical system exception.
class Winter\Storm\Exception\SystemException
extends Winter\Storm\Exception\ExceptionBase
System exceptions are logged in the error log.
Extends
Class | Description |
---|---|
ExceptionBase
|
The base exception class. |
Properties
inherited public $hint : string
Hint Message to help the user with troubleshooting the error (optional).
inherited protected $className : string
Class name of the called Exception.
inherited protected $errorType : string
Error type derived from the error code. Will be 'Undefined' if no code is used.
inherited
protected
$fileContent
:
array
= []
File content relating to the exception, each value of the array is a file line number.
inherited protected $highlight : object
Cached code information for highlighting code.
inherited protected $mask : Throwable
If this exception is acting as a mask, this property stores the face exception.
Methods
public
__construct (string $message = ""
, integer $code, Throwable $previous = null
)
Override the constructor to escape all messages to protect against potential XSS from user provided inputs being included in the exception message
Property | Type | Description |
---|---|---|
$message | string |
string
Error message. |
$code | integer |
integer
Error code. |
$previous | Throwable |
Throwable
Previous exception. |
inherited public applyMask (Throwable $exception) : void
This method is used when applying the mask exception to the face exception.
It can be used as an override for child classes who may use different masking logic.
Property | Type | Description |
---|---|---|
$exception | Throwable |
Throwable
Face exception being masked. |
inherited public getCallStack () : array
Returns the call stack as an array of values containing a stack information object.
with stack information, each value will be an object with these values: id - The stack ID number. code - The class and function name being called. args - The arguments passed to the code function above. file - Reference to the file containing the called code. line - Reference to the line number of the file.
inherited public getClassName () : string
Returns the class name of the called Exception.
inherited public getErrorType () : string
Returns the error type derived from the error code used.
inherited public getHighlight () : object
Generates information used for highlighting the area of code in context of the exception line number.
The highlighted block of code will be six (6) lines before and after the problem line number.
Highlight information as an object, the following keys are supplied: startLine - The starting line number, 6 lines before the error line. endLine - The ending line number, 6 lines after the error line. errorLine - The focused error line number. lines - An array of all the lines to be highlighted, each value is a line of code.
inherited public getHighlightLines () : array
Returns an array of line numbers used for highlighting the problem area of code.
This will be six (6) lines before and after the error line number.
Array of code lines.
inherited public getTrueException () : Throwable
If this exception is acting as a mask, return the face exception. Otherwise return this exception as the true one.
The underlying exception, or this exception if no mask is applied.
inherited
public
static
mask (string $message = null
, integer $code)
: void
Masks an exception with the called class. This should catch fatal and php errors.
It should always be followed by the unmask() method to remove the mask.
Property | Type | Description |
---|---|---|
$message | string |
string
Error message. |
$code | integer |
integer
Error code. |
inherited public setMask (Throwable $exception) : void
If this exception acts as a mask, sets the face for the foreign exception.
Property | Type | Description |
---|---|---|
$exception | Throwable |
Throwable
Face for the mask, the underlying exception. |
inherited public static unmask () : void
Removes the active mask from the called class.
inherited protected filterCallStack (array $traceInfo) : array
Removes the final steps of a call stack, which add no value for the user.
The following exceptions and any trace information afterwards will be filtered:
- Illuminate\Foundation\Bootstrap\HandleExceptions
Property | Type | Description |
---|---|---|
$traceInfo | array |
array
The trace information from getTrace() or debug_backtrace(). |
The filtered array containing the trace information.
inherited protected formatStackArguments (array $arguments) : string
Prepares a function or method argument list for display in HTML or text format
Property | Type | Description |
---|---|---|
$arguments | array |
array
A list of the function or method arguments |