← Back to team overview

mahara-contributors team mailing list archive

[Bug 1855771] A change has been merged

 

Reviewed:  https://reviews.mahara.org/10661
Committed: https://git.mahara.org/mahara/mahara/commit/9b35263dde89fb94b74b11806ae028dd2d83ff45
Submitter: Cecilia Vela Gurovic (ceciliavg@xxxxxxxxxxxxxxx)
Branch:    master

commit 9b35263dde89fb94b74b11806ae028dd2d83ff45
Author: Robert Lyon <robertl@xxxxxxxxxxxxxxx>
Date:   Tue Dec 10 09:12:34 2019 +1300

Bug 1855771: Allow generic system errors to give more detail

So that we can debug things easier

The Exception class has two useful methods, getFile() and getLine()
so we can use these to dispaly where the problem is rather than just
a generic:  exception(object(ParseError)) at Unknown:0

To test:
- a syntax mistake - add a log_debug() line before the first function in a class
and see if the error shows the correct file/line
- MaharaException - add the following line somewher ein the code
throw new MaharaException("Missing bananas");
and see if the error shows the correct file/line

behatnotneeded

Change-Id: I5a254f842ab6444ebb324e11e2c93d1c44e3e1d3
Signed-off-by: Robert Lyon <robertl@xxxxxxxxxxxxxxx>

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1855771

Title:
  Allow non-mahara exceptions to show a bit more detail

Status in Mahara:
  Fix Committed

Bug description:
  When you see errors like:

  [WAR] 9c (lib/errors.php:536) [ParseError]: syntax error, unexpected 'parent' (T_STRING), expecting function (T_FUNCTION)
   Call stack (most recent first):
     * exception(object(ParseError)) at Unknown:0
   
  It is not obvious to where the problem is - especially if you are cherry-picking in a bunch of patches and so are not familiar with the code

  With PHP Exception class there are some bits we can harness to help up
  https://www.php.net/manual/en/class.exception.php

  The getFile() and getLine() methods will be useful

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1855771/+subscriptions


References