You are here

function devel_set_handler in Devel 7

Same name and namespace in other branches
  1. 8.3 devel.module \devel_set_handler()
  2. 8 devel.module \devel_set_handler()
  3. 8.2 devel.module \devel_set_handler()
  4. 6 devel.module \devel_set_handler()
  5. 4.x devel.module \devel_set_handler()

Sets a new error handler or restores the prior one.

Parameters

array $handlers: An array of error handlers to set. Use an empty array to restore the previous one.

1 call to devel_set_handler()
devel_init in ./devel.module
Implements hook_init().

File

./devel.module, line 621
This module holds functions useful for Drupal development.

Code

function devel_set_handler($handlers) {
  if (empty($handlers)) {
    restore_error_handler();
  }
  elseif (count($handlers) == 1 && isset($handlers[DEVEL_ERROR_HANDLER_STANDARD])) {

    // Do nothing.
  }
  else {
    if (has_krumo()) {
      set_error_handler('backtrace_error_handler');
    }
  }
}