ApplicationException

This class represents an application exception.

 class Winter\Storm\Exception\ApplicationException
extends Winter\Storm\Exception\ExceptionBase

Application exceptions are not logged in the error log.

Properties

public $hint : string

Inherited from ExceptionBase

Hint Message to help the user with troubleshooting the error (optional).

protected $className : string

Inherited from ExceptionBase

Class name of the called Exception.

protected $errorType : string

Inherited from ExceptionBase

Error type derived from the error code. Will be 'Undefined' if no code is used.

protected $fileContent : array

Inherited from ExceptionBase

File content relating to the exception, each value of the array is a file line number.

protected $highlight : object

Inherited from ExceptionBase

Cached code information for highlighting code.

protected $mask : Throwable

Inherited from ExceptionBase

If this exception is acting as a mask, this property stores the face exception.

Methods

public __construct (string $message = "", integer $code, Exception $previous = null)

Override the constructor to escape all messages to protect against potential XSS from user provided inputs being included in the exception message

Parameters
Property Description
$message
string

Error message.

$code
integer

Error code.

$previous
Exception

Previous exception.

Returns
mixed

public applyMask (Throwable $exception) : void

Inherited from ExceptionBase

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.

Parameters
Property Description
$exception
Throwable

Face exception being masked.

Returns
void

public getCallStack () : array

Inherited from ExceptionBase

Returns the call stack as an array of values containing a stack information object.

Returns
array

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.

public getClassName () : string

Inherited from ExceptionBase

Returns the class name of the called Exception.

Returns
string

public getErrorType () : string

Inherited from ExceptionBase

Returns the error type derived from the error code used.

Returns
string

public getHighlight () : object

Inherited from ExceptionBase

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.

Returns
object

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.

public getHighlightLines () : array

Inherited from ExceptionBase

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.

Returns
array

Array of code lines.

public getTrueException () : Throwable

Inherited from ExceptionBase

If this exception is acting as a mask, return the face exception. Otherwise return this exception as the true one.

Returns
Throwable

The underlying exception, or this exception if no mask is applied.

public static mask (string $message = null, integer $code) : void

Inherited from ExceptionBase

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.

Parameters
Property Description
$message
string

Error message.

$code
integer

Error code.

Returns
void

public setMask (Throwable $exception) : void

Inherited from ExceptionBase

If this exception acts as a mask, sets the face for the foreign exception.

Parameters
Property Description
$exception
Throwable

Face for the mask, the underlying exception.

Returns
void

public static unmask () : void

Inherited from ExceptionBase

Removes the active mask from the called class.

Returns
void

protected filterCallStack (array $traceInfo) : array

Inherited from ExceptionBase

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
Parameters
Property Description
$traceInfo
array

The trace information from getTrace() or debug_backtrace().

Returns
array

The filtered array containing the trace information.

protected formatStackArguments (array $arguments) : string

Inherited from ExceptionBase

Prepares a function or method argument list for display in HTML or text format

Parameters
Property Description
$arguments
array

A list of the function or method arguments

Returns
string
Copyright © 2024 Winter CMS