You are here

protected function DrupalTestCase::exceptionHandler in SimpleTest 6.2

Same name and namespace in other branches
  1. 7.2 drupal_web_test_case.php \DrupalTestCase::exceptionHandler()
  2. 7 drupal_web_test_case.php \DrupalTestCase::exceptionHandler()

Handle exceptions.

See also

set_exception_handler

1 call to DrupalTestCase::exceptionHandler()
DrupalTestCase::run in ./drupal_web_test_case.php
Run all tests in this class.

File

./drupal_web_test_case.php, line 535

Class

DrupalTestCase
Base class for Drupal tests.

Code

protected function exceptionHandler($exception) {
  $backtrace = $exception
    ->getTrace();

  // Push on top of the backtrace the call that generated the exception.
  array_unshift($backtrace, array(
    'line' => $exception
      ->getLine(),
    'file' => $exception
      ->getFile(),
  ));
  $this
    ->error($exception
    ->getMessage(), 'Uncaught exception', _drupal_get_last_caller($backtrace));
}