class ErrorOutputHandler extends AbstractProcessingHandler (View source)

Output the error to either the browser or the terminal, depending on the context we're running in.

Methods

public
string
getContentType()

Get the mime type to use when displaying this error.

public
setContentType(string $contentType)

Set the mime type to use when displaying this error.

public
int
getStatusCode()

Get the HTTP status code to use when displaying this error.

public
$this
setStatusCode(int $statusCode)

Set the HTTP status code to use when displaying this error.

public
setCLIFormatter(FormatterInterface $cliFormatter)

Set a formatter to use if Director::is_cli() is true

public
FormatterInterface
getCLIFormatter()

Return the formatter use if Director::is_cli() is true If none has been set, null is returned, and the getFormatter() result will be used instead

public
FormatterInterface
getFormatter()

Return the formatter to use in this case.

public
FormatterInterface
getDefaultFormatter()

Check default formatter to use

public
$this
setDefaultFormatter(FormatterInterface $formatter)

Set default formatter

protected
bool
shouldShowError(int $errorCode)

No description

protected
void
write(LogRecord $record)

No description

Details

string getContentType()

Get the mime type to use when displaying this error.

Return Value

string

ErrorOutputHandler setContentType(string $contentType)

Set the mime type to use when displaying this error.

Default text/html

Parameters

string $contentType

Return Value

ErrorOutputHandler

Return $this to allow chainable calls

int getStatusCode()

Get the HTTP status code to use when displaying this error.

Return Value

int

$this setStatusCode(int $statusCode)

Set the HTTP status code to use when displaying this error.

Default 500

Parameters

int $statusCode

Return Value

$this

ErrorOutputHandler setCLIFormatter(FormatterInterface $cliFormatter)

Set a formatter to use if Director::is_cli() is true

Parameters

FormatterInterface $cliFormatter

Return Value

ErrorOutputHandler

Return $this to allow chainable calls

FormatterInterface getCLIFormatter()

Return the formatter use if Director::is_cli() is true If none has been set, null is returned, and the getFormatter() result will be used instead

Return Value

FormatterInterface

FormatterInterface getFormatter()

Return the formatter to use in this case.

May be the getCliFormatter() value if one is provided and Director::is_cli() is true.

Return Value

FormatterInterface

FormatterInterface getDefaultFormatter()

Check default formatter to use

Return Value

FormatterInterface

$this setDefaultFormatter(FormatterInterface $formatter)

Set default formatter

Parameters

FormatterInterface $formatter

Return Value

$this

protected bool shouldShowError(int $errorCode)

No description

Parameters

int $errorCode

Return Value

bool

protected void write(LogRecord $record)

No description

Parameters

LogRecord $record

Return Value

void