MantisBT: master 167ca0f6

Author Committer Branch Timestamp Parent
dregad dregad master 2014-05-12 03:51 master fd2608dd
Affected Issues  0017270: PHP Deprecated, Warnings and Notices kill CLI scripts
Changeset

Improve error handling for command-line scripts

Commit 461a7115d37de79e4875b651edd10fd556a533c3 added CLI-specific
handling for errors to display messages without HTML formatting.

This introduced a regression, causing scripts to abort even for
non-critical errors that would normally allow execution to continue
(such as PHP warnings as well as system and deprecated notices).
Furthermore, in that case the exit code is 0, so the caller is not able
to detect the failure to take appropriate action.

This improves how CLI errors are managed, making it similar to regular
MantisBT error handling, i.e.

  • honor $g_display_errors settings
    • abort only for DISPLAY_ERROR_HALT (in that case exit code is 1)
    • don't print message if DISPLAY_ERROR_NONE
  • handle E_DEPRECATED error type
  • improve message for unhandled error types
  • print a debug backtrace when show_detailed_errors == ON

Fixes 0017270

mod - core/error_api.php Diff File