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

Throwing exceptions for missing records is unfriendly to users

    XMLWordPrintable

Details

    • MOODLE_402_STABLE

    Description

      In Moodle we heavily over-use and abuse exceptions. We use them correctly in many cases, but we also do things like fetching a course record at the top of course/view.php and throwing an exception if it was not found.

      Quite frankly, this is rubbish. It's a terrible user experience, it's a meaningless and horrible error message, and it fills server logs with scary looking exception notices for things which, whilst a fatal error, are usually a problem with an old link for a deleted activity/course/etc. For example:
      https://moodle.org/course/view.php?id=3

      Similarly, throwing an exception for a missing required param with a meaningless message is also unhelpful, for example:
      https://moodle.org/help.php

      We need to do better!

      Attachments

        Activity

          People

            Unassigned Unassigned
            dobedobedoh Andrew Lyons
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Clockify

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.