jakartaee / jakartaee/messaging
Clarify the difference (if any) between JMSException.getLinkedException() and JMSException.getCause()
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 49
- Forks
- 34
- PR merge metrics
- No merged PRs in 30d
Description
JMSException.getLinkedException() is usually containing the provider-specific Exception object, but there's also already the inherited Exception.getCause() method.
JMS Providers could potentially return different things in each method, which would be confusing.
Also, 'exception un-nesting code' would typically use Exception.getCause() multiple times until getCause() returns null to get to the root cause which then usually contains a better error description. Since this 'exception un-nesting code' could catch exceptions from multiple API's it would be nice if JMS behaves just like any other library (let getCause() return the cause of the exception).
My proposal would be to require JMS providers to implement JMSException.getCause() like this:
@Override
public Throwable getCause()
{
return getLinkedException();
}
That way, JMS wouldn't play a special role when interpreting the cause of an exception.
Affected Versions
[2.0]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the JMSException methods named in the issue and the affected JMS 2.0 API behavior. Determine whether getCause() must mirror getLinkedException() and what provider behavior the specification should require; done means the relationship is unambiguously defined.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100