|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.microsoft.tfs.core.exceptions.mappers.TECoreExceptionMapper
public abstract class TECoreExceptionMapper
Basic exception mapper.
Exception mappers provide a static method that takes an exception thrown from a lower level (SOAP library, for instance) that must be mapped into a TFS domain-specific exception before it leaves core. This practice prevents exception types from leaking upwards to clients without the proper TFS client context.
A mapper is needed because SOAPService
's methods may throw
SOAPFault
exceptions when web service methods are invoked. Because
TFS formats the data inside a SOAPFault
differently for each type of
web service, core clients must transform this exception into a more specific
type of exception to give to the caller. Applications using core will then
receive more precise exception types that are easier to filter on and format
for display. These mapper classes provide this functionality with
client-specific knowledge.
You can't call map(RuntimeException)
directly on this class, so call
it on the appropriate client-specific class in this package instead.
Constructor Summary | |
---|---|
TECoreExceptionMapper()
|
Method Summary | |
---|---|
protected static java.lang.RuntimeException |
map(java.lang.RuntimeException e)
Takes any Exception and returns a more specific
TECoreException that can be thrown in its place, if a more
specific type is known. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TECoreExceptionMapper()
Method Detail |
---|
protected static java.lang.RuntimeException map(java.lang.RuntimeException e)
Exception
and returns a more specific
TECoreException
that can be thrown in its place, if a more
specific type is known. If no better class is known, the given exception
is returned unaltered.
e
- the Exception
to map (find a more specific exception for).
If null, null is returned.
TECoreException
that can be used in
place of the given exception, or null if the given exception was
null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |