← Back to team overview

mahara-contributors team mailing list archive

[Bug 1542126] Re: Get rid of "THIS IS BAD" message for Exceptions that don't subclass MaharaException

 

** Changed in: mahara
       Status: In Progress => Fix Committed

-- 
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/1542126

Title:
  Get rid of "THIS IS BAD" message for Exceptions that don't subclass
  MaharaException

Status in Mahara:
  Fix Committed

Bug description:
  Since 2006, Mahara's exception handler has displayed this message if
  it handles an exception that is not a subclass of MaharaException:

  [WAR] 1b (lib/errors.php:457) An exception was thrown of class Exception.
  THIS IS BAD and should be changed to something extending MaharaException,
  unless the exception is from a third party library.
  Original trace follows

  This may have been useful in 2006 when MaharaException was new, but
  since then we have pretty much eliminated cases in the core code where
  this would be useful, and it pretty much only comes up with false
  positives where the exception really is from a third-party library.

  This message is also displayed if an instance of MaharaException
  (rather than a subclass of it) is caught. Again, maybe necessary in
  2006 when we were supporting PHP4, but with PHP 5 we can just make
  MaharaException abstract, which will make it impossible to be
  instantiated directly.

  As such, the message is unneccesary and just clutters up logs and adds
  an extra bit of panic and confusion to admins new to Mahara. So I
  think it'd be better to remove it, and simply print something like
  "[External library exception]:"

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


References