Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-20676 Error, exception and debug handling improvements
  3. MDL-20695

trigger_error() is used incorrectly in several places

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: General
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      trigger_error() can not be used for informing users about fatal errors because it may not be displayed at all, it can be used only for debugging purposes
      I think it should be better to use debugging() + error_log() instead in some cases

      You can test it with following, it results in white page of death:

      <?php
      ini_set('display_errors', '0');
      trigger_error('grrr');

      We should not use trigger_error() before setting our error levels too because it leaks sensitive information.

      Current default exception handler logs every print_error() in minimal debug mode.

        Attachments

          Activity

            People

            Assignee:
            skodak Petr Skoda
            Reporter:
            skodak Petr Skoda
            Tester:
            Nobody
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              24/Nov/10