Skip to content

Commit

Permalink
Specify recovery error handling with 'recoverable-errors-handling' op…
Browse files Browse the repository at this point in the history
…tion.

Defaults to 'skip' and execution is halted with the value 'halt'.
  • Loading branch information
mdeletter committed Dec 28, 2015
1 parent edddfe5 commit 2a6ccbf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions examples/example.drushrc.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,13 @@
*/
# $options['php-notices'] = 'warning';

/**
* Specify the error handling of recoverable errors (E_RECOVERABLE_ERROR).
* Defaults to "ignore". Will stop further execution of Drush, when set to "halt"
* (same behaviour as Drupal core).
*/
# $options['recoverable-errors-handling'] = 'halt';

/**
* Specify options to pass to ssh in backend invoke. The default is to prohibit
* password authentication, and is included here, so you may add additional
Expand Down
3 changes: 2 additions & 1 deletion includes/environment.inc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function drush_error_handler($errno, $message, $filename, $line, $context) {
if ($errno & error_reporting()) {
// By default we log notices.
$type = drush_get_option('php-notices', 'notice');
$recoverable_errors_handling = drush_get_option('recoverable-errors-handling', 'skip');

// Bitmask value that constitutes an error needing to be logged.
$error = E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR;
Expand All @@ -43,7 +44,7 @@ function drush_error_handler($errno, $message, $filename, $line, $context) {

drush_log($message . ' ' . basename($filename) . ':' . $line, $type);

if ($errno == E_RECOVERABLE_ERROR) {
if ($recoverable_errors_handling == 'halt' && $errno == E_RECOVERABLE_ERROR) {
exit(DRUSH_APPLICATION_ERROR);
}

Expand Down

0 comments on commit 2a6ccbf

Please sign in to comment.