You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2010/01/31 02:35:34 UTC
[jira] Created: (LANG-585)
exception.DefaultExceptionContext.getFormattedExceptionMessage catches
Throwable
exception.DefaultExceptionContext.getFormattedExceptionMessage catches Throwable
--------------------------------------------------------------------------------
Key: LANG-585
URL: https://issues.apache.org/jira/browse/LANG-585
Project: Commons Lang
Issue Type: Bug
Reporter: Sebb
It's generally a bad idea to catch Throwable.
The getFormattedExceptionMessage method should be changed to catch less; e.g. Exception + RuntimeException should be adequate.
The Javadoc examples in ContextedException and ContextedRuntimeException suggest catching Throwable; these examples should be changed too.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LANG-585)
exception.DefaultExceptionContext.getFormattedExceptionMessage catches
Throwable
Posted by "Sebb (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sebb updated LANG-585:
----------------------
Component/s: lang.exception.*
> exception.DefaultExceptionContext.getFormattedExceptionMessage catches Throwable
> --------------------------------------------------------------------------------
>
> Key: LANG-585
> URL: https://issues.apache.org/jira/browse/LANG-585
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.exception.*
> Affects Versions: 3.0
> Reporter: Sebb
>
> It's generally a bad idea to catch Throwable.
> The getFormattedExceptionMessage method should be changed to catch less; e.g. Exception + RuntimeException should be adequate.
> The Javadoc examples in ContextedException and ContextedRuntimeException suggest catching Throwable; these examples should be changed too.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (LANG-585)
exception.DefaultExceptionContext.getFormattedExceptionMessage catches
Throwable
Posted by "Sebb (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-585?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12829037#action_12829037 ]
Sebb commented on LANG-585:
---------------------------
Also fixed Javadoc that referred to Throwable:
URL: http://svn.apache.org/viewvc?rev=906015&view=rev
Log:
LANG-585. Don't suggest catching Throwable, catch Exception instead.
Modified:
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/exception/ContextedException.java
commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/exception/ContextedRuntimeException.java
> exception.DefaultExceptionContext.getFormattedExceptionMessage catches Throwable
> --------------------------------------------------------------------------------
>
> Key: LANG-585
> URL: https://issues.apache.org/jira/browse/LANG-585
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.exception.*
> Reporter: Sebb
> Fix For: 3.0
>
>
> It's generally a bad idea to catch Throwable.
> The getFormattedExceptionMessage method should be changed to catch less; e.g. Exception + RuntimeException should be adequate.
> The Javadoc examples in ContextedException and ContextedRuntimeException suggest catching Throwable; these examples should be changed too.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (LANG-585)
exception.DefaultExceptionContext.getFormattedExceptionMessage catches
Throwable
Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henri Yandell closed LANG-585.
------------------------------
Resolution: Fixed
Fixed - Exception caught now instead of Throwable. That handles RuntimeException too.
svn ci -m "Fixing LANG-585. Don't catch Throwable, catch Exception instead. "
Sending src/main/java/org/apache/commons/lang3/exception/DefaultExceptionContext.java
Transmitting file data .
Committed revision 905922.
> exception.DefaultExceptionContext.getFormattedExceptionMessage catches Throwable
> --------------------------------------------------------------------------------
>
> Key: LANG-585
> URL: https://issues.apache.org/jira/browse/LANG-585
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.exception.*
> Reporter: Sebb
> Fix For: 3.0
>
>
> It's generally a bad idea to catch Throwable.
> The getFormattedExceptionMessage method should be changed to catch less; e.g. Exception + RuntimeException should be adequate.
> The Javadoc examples in ContextedException and ContextedRuntimeException suggest catching Throwable; these examples should be changed too.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LANG-585)
exception.DefaultExceptionContext.getFormattedExceptionMessage catches
Throwable
Posted by "Henri Yandell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Henri Yandell updated LANG-585:
-------------------------------
Affects Version/s: (was: 3.0)
Fix Version/s: 3.0
Agreed, setting fix version to 3.0.
> exception.DefaultExceptionContext.getFormattedExceptionMessage catches Throwable
> --------------------------------------------------------------------------------
>
> Key: LANG-585
> URL: https://issues.apache.org/jira/browse/LANG-585
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.exception.*
> Reporter: Sebb
> Fix For: 3.0
>
>
> It's generally a bad idea to catch Throwable.
> The getFormattedExceptionMessage method should be changed to catch less; e.g. Exception + RuntimeException should be adequate.
> The Javadoc examples in ContextedException and ContextedRuntimeException suggest catching Throwable; these examples should be changed too.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (LANG-585)
exception.DefaultExceptionContext.getFormattedExceptionMessage catches
Throwable
Posted by "Sebb (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/LANG-585?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sebb updated LANG-585:
----------------------
Affects Version/s: 3.0
> exception.DefaultExceptionContext.getFormattedExceptionMessage catches Throwable
> --------------------------------------------------------------------------------
>
> Key: LANG-585
> URL: https://issues.apache.org/jira/browse/LANG-585
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.exception.*
> Affects Versions: 3.0
> Reporter: Sebb
>
> It's generally a bad idea to catch Throwable.
> The getFormattedExceptionMessage method should be changed to catch less; e.g. Exception + RuntimeException should be adequate.
> The Javadoc examples in ContextedException and ContextedRuntimeException suggest catching Throwable; these examples should be changed too.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.