-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Admin app - catch exceptions thrown by JLog::add() #13504
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,13 +137,27 @@ public function delete(&$pks) | |
|
||
if ($error) | ||
{ | ||
JLog::add($error, JLog::WARNING, 'jerror'); | ||
try | ||
{ | ||
JLog::add($error, JLog::WARNING, 'jerror'); | ||
} | ||
catch (RuntimeException $exception) | ||
{ | ||
JFactory::getApplication()->enqueueMessage($error, 'warning'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same this file There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one already has an error set, look above; the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then do we need to do anything other than pass here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this weren't logging to the |
||
} | ||
|
||
return false; | ||
} | ||
else | ||
{ | ||
JLog::add(JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'), JLog::WARNING, 'jerror'); | ||
try | ||
{ | ||
JLog::add(JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'), JLog::WARNING, 'jerror'); | ||
} | ||
catch (RuntimeException $exception) | ||
{ | ||
JFactory::getApplication()->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_DELETE_NOT_PERMITTED'), 'warning'); | ||
} | ||
|
||
return false; | ||
} | ||
|
@@ -264,13 +278,27 @@ public function keep(&$pks) | |
|
||
if ($error) | ||
{ | ||
JLog::add($error, JLog::WARNING, 'jerror'); | ||
try | ||
{ | ||
JLog::add($error, JLog::WARNING, 'jerror'); | ||
} | ||
catch (RuntimeException $exception) | ||
{ | ||
JFactory::getApplication()->enqueueMessage($error, 'warning'); | ||
} | ||
|
||
return false; | ||
} | ||
else | ||
{ | ||
JLog::add(JText::_('COM_CONTENTHISTORY_ERROR_KEEP_NOT_PERMITTED'), JLog::WARNING, 'jerror'); | ||
try | ||
{ | ||
JLog::add(JText::_('COM_CONTENTHISTORY_ERROR_KEEP_NOT_PERMITTED'), JLog::WARNING, 'jerror'); | ||
} | ||
catch (RuntimeException $exception) | ||
{ | ||
JFactory::getApplication()->enqueueMessage(JText::_('COM_CONTENTHISTORY_ERROR_KEEP_NOT_PERMITTED'), 'warning'); | ||
} | ||
|
||
return false; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it not better to call setError here? Especially given this is largely being used for non-html dumps and the view can format handle appropriately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well remember, most views have a
if $this->get('Errors')
style check which basically turns the view into an error page if there are errors found. The current handling of this method doesn't seem to indicate it should cause that to happen.