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

Whoops should not capture exceptions in webservices

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.3.3, 4.4
    • General
    • MOODLE_403_STABLE, MOODLE_404_STABLE

      If there is an exception thrown in a webservice apart from the core rest webservice, Whoops overrides the exception name, for example:

      {
          "exception": "Whoops\\Exception\\ErrorException",
          "message": "Attempt to read property \"quizid\" on array"
      }

      I noticed this when using webservice_restful ( https://github.com/catalyst/moodle-webservice_restful )

      I'm not 100% sure why this does not affect the core Rest webservice (I have not tested soap), but nevertheless I think Whoops should never activate when using webservices, as it was originally intended only for web requests.

      Adding

      || WS_SERVER

      here https://github.com/moodle/moodle/blob/f30110b5ebf9090ee484986e020d43a7819fc436/lib/setuplib.php#L354

      appears to fix it

       

       

            Unassigned Unassigned
            matthewhilton Matthew Hilton
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

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