Skip to content

[4.0] Empty catch statement#27638

Merged
rdeutz merged 3 commits intojoomla:4.0-devfrom
brianteeman:drupal_sprint_weekend6
Feb 3, 2020
Merged

[4.0] Empty catch statement#27638
rdeutz merged 3 commits intojoomla:4.0-devfrom
brianteeman:drupal_sprint_weekend6

Conversation

@brianteeman
Copy link
Copy Markdown
Contributor

My ide is telling me that it is bad to have an empty catch statement and if there is one then it should have a comment. Following the example of @roland-d @mbabker and others I added a comment

My ide is telling me that it is bad to have an empty catch statement and if there is one then it should have a comment. Following the example of @rolandd @mbabker and others I added a comment
@Quy
Copy link
Copy Markdown
Contributor

Quy commented Jan 25, 2020

I have tested this item ✅ successfully on 1b25730


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27638.

}
catch (\RuntimeException $e)
{
// Ignore it
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally try to use a comment to explain why the catch block is basically no-opped, that way someone coming along later knows why it’s empty and doesn’t assume it’s an error there’s no code there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Search the code. I just copied exactly what you have done :)

@richard67
Copy link
Copy Markdown
Member

I have tested this item ✅ successfully on 1b25730

Code review.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27638.

@richard67
Copy link
Copy Markdown
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/27638.

@joomla-cms-bot joomla-cms-bot added RTC This Pull Request is Ready To Commit PR-4.0-dev labels Jan 26, 2020
@rdeutz rdeutz added this to the Joomla 4.0 milestone Feb 3, 2020
@rdeutz rdeutz merged commit c2431b4 into joomla:4.0-dev Feb 3, 2020
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Feb 3, 2020
@brianteeman
Copy link
Copy Markdown
Contributor Author

Thanks

@brianteeman brianteeman deleted the drupal_sprint_weekend6 branch February 3, 2020 22:09
brianteeman added a commit to brianteeman/joomla-cms that referenced this pull request Feb 4, 2020
My ide is telling me that it is bad to have an empty catch statement and if there is one then it should have a comment. Following the example of @rolandd @mbabker and others I added a comment

Co-authored-by: Quy <quy@fluxbb.org>
Co-authored-by: Robert Deutz <rdeutz@googlemail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants