joomla/joomla-platform — pull request #689 by elkuku (2011-12-31 21:54:51+00:00)
Title: Fix: improper message is displayed on database connection error

This is an attempt to solve CMS tracker items [#26550](http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=26550) and [#27574](http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=27574).

**Symptom:**
If the database connection fails for "some reason" this is not properly reported.

**Results:**
26550: Infinite loop in JError
27574: jos-Error: Application Instantiation Error

Both are not really helpful.

**Possible solution:**
a) (best) Throw a JDatabaseException and handle it properly - not possible yet :(
b) (current) "Throw" a JError::raiseError(500... which is not handled properly and actually ends up as the aforementioned application instantiation error.
c) (proposed) Plain dead ```die()``` with an appropriate (non JText*ed*) message if the (also deprecated) $db->getErrorNum() function returns "something".

Maybe someone can provide a much cleaner solution, but in the meantime I would find it a bit #%&@¿ if the Joomla! CMS 2.5 stable would be released with this thingy still present...