Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-33565

Better error message if you try to pass an object as $debuginfo for an exception

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3
    • 2.3
    • Libraries
    • MOODLE_23_STABLE
    • MOODLE_23_STABLE
    • Hide

      Create a test script like:

      <?php
      require_once('config.php');
      throw new coding_exception('Oops', new stdClass());

      when you run it, you should be able to see that the error was caused by line 3 of test.php.

      Show
      Create a test script like: <?php require_once('config.php'); throw new coding_exception('Oops', new stdClass()); when you run it, you should be able to see that the error was caused by line 3 of test.php.

    Description

      See the comments on MDL-23884 where currently the error messages are very unhelpful. With this one-line change, the error is triggered in a place where the stack-trace is much more helpful.

      Attachments

        Issue Links

          Activity

            People

              timhunt Tim Hunt
              timhunt Tim Hunt
              Petr Skoda Petr Skoda
              Dan Poltawski Dan Poltawski
              Dan Poltawski Dan Poltawski
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                25/Jun/12