_drupal_decode_exception

function _drupal_decode_exception

_drupal_decode_exception($exception)

Decodes an exception and retrieves the correct caller.

Parameters

$exception: The exception object that was thrown.

Return value

An error in the format expected by _drupal_log_error().

File

includes/errors.inc, line 88
Functions for error handling.

Code

function _drupal_decode_exception($exception) {
  $message = $exception->getMessage();

  $backtrace = $exception->getTrace();
  // Add the line throwing the exception to the backtrace.
  array_unshift($backtrace, array('l