An exception represents an occurrence that, if not handled explicitly within the map, stops the map's execution. During the execution of a map, run-time exceptions can occur. When you define a custom transformation rule, you can use the "Catch Error" function block to trap any run-time exception. Once you catch a particular exception, you can determine how to handle this exception.
When using relationships in a map, several exceptions can occur. All of these exceptions are subclasses of RelationshipRuntimeException. If you are not concerned about the kind of exception, but simply want to catch them all, you can catch RelationshipRuntimeException. Otherwise, you can catch any of the following exceptions for specific cases:
Example: The exception is thrown if you pass a business object of the wrong type to the create() method.
Figure 75 illustrates the relationship run-time exception
hierarchy. Any exception you catch automatically catches those that are
lower in the hierarchy. However, if an exception lower in the hierarchy
is thrown, you cannot know exactly which one it is unless you catch it
specifically.
Figure 75. Relationship run-time exceptions
Example: If you catch RelationshipRuntimeUserErrorException, you automatically also catch RelationshipRuntimeMetaDataErrorException and RelationshipRuntimeGeneralUserErrorException. However, you cannot easily know which one of these was actually thrown, unless you test the exception with the instance of operator. The exception you choose to catch depends on how specific you want your exception handling to be.