drush icon indicating copy to clipboard operation
drush copied to clipboard

Log CLI errors using Drupal error handler

Open Chi-teck opened this issue 1 year ago • 1 comments

Currently PHP errors that happen in Drush commands are not logged to Drupal. When Drush commands are running in background through Cron or Supervisor there is no way to notice these errors. For that reason I have to prepend each custom Drush command with the following line.

\set_error_handler('_drupal_error_handler');

The downside of this is that it'll not display a error when the command is running in foreground.

The simplest solution is to call the Drupal error handler manually.

Chi-teck avatar Dec 29 '23 15:12 Chi-teck

Drupal may not be bootstrapped yet. thsi doesnt look right to me. Also see the comment at top

**
 * Log PHP errors to the Drush log. This is in effect until Drupal's error
 * handler takes over.
 */

weitzman avatar Jan 11 '24 21:01 weitzman

Not planned.

weitzman avatar Apr 18 '24 01:04 weitzman