History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-14257
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Dmitry Jemerov
Reporter: Dave Makower
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

Catch Statement Body template needs built-in variable type for exceptionClassThrowableHere()

Created: 08 Feb 07 01:05   Updated: 05 Aug 08 19:44
Component/s: Editor. Code Completion
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Issue Links:
Relates
 
This issue is related to:
IDEADEV-14781 Live Templates Normal Open

Build: 6,148
Severity: Medium


 Description  « Hide
The live template for catch statement body (and potentially other templates as well) needs a variable type for exceptionClassThrowableHere(). Very often, what one wants to do inside of a catch body is to wrap an exception inside one that is acceptable to be thrown in the current context – which would be selected from a menu containing the union of all exception classes the method can throw and all exception classes already caught by try/catch blocks within which the current block is lexically nested.

This way, you could have the catch statement body template look something like this:

throw new ${THROWABLE_EXCEPTION_CLASS}(${EXCEPTION});

resulting in code like:

try {
doSomethingInAnotherDomain();
} catch (OtherDomainException e) {
throw MyDomainException(e);
}

[Not sure whether I've logged this to the correct component; there is no File Templates or Live Templates component in the issue tracker.]



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.