User tests: Successful: Unsuccessful:
At the moment if an error occurs we get just "An error has occurred" message and not anything helpful.
Today the error was "Out of sort memory, consider increasing server sort buffer size" which would have been a hell of a lot better output than just "An Error has occurred"
As this is the /administrator/ menu helper I dont see any reason why we should not display the exception message instead of a generic error message?
@mbabker
https://twitter.com/blueflameit/status/877887820286746624
Status | New | ⇒ | Pending |
Category | ⇒ | Modules Administration |
we don't want to expose to the user
This is the admin console... I guess its not right to send the whole exception as it will not always be the super admin using the admin console, but equally its not right to just say an error happened, and not in what context (in this case, admin menu helper), because the generic message could have been raised, literally, anywhere and it takes someone like me to debug what the root issue was and where and in what context....
Because in many cases this contains the database query that failed to execute which we don't want to expose to the user
With the new database exceptions we aren't exposing the raw query anymore. At worst you're getting the database engine's error message.
Redundant PR as someone has already refactored this file while this PR was left open a year, and this is now a non issue as the new code is more helpful
JFactory::getApplication()->enqueueMessage(JText::sprintf('JERROR_LOADING_MENUS', $e->getMessage()), 'error');
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-11-12 01:29:06 |
Closed_By | ⇒ | PhilETaylor |
Because in many cases this contains the database query that failed to execute which we don't want to expose to the user