Handle Exceptions For | |
Any EMMLStatement | <invoke> or <directinvoke> |
Use the <try>/<catch> statements to catch and handle exceptions thrown from any EMML statement. These statements work very much like try-catch in other programming languages. See for a simple example. You define how to handle an exception with EMML statements in the <catch> block. You can use almost any EMML statement in a <catch> block, including with <throw> or with <return/>. You can use multiple <catch> blocks to catch and handle different types of exceptions based on the exception class name you specify in each <catch> block. See for more information on how exception matching is handled, examples and links to the specific exception classes that can be thrown by different EMML statements. Also see Mashup Samples for working mashup samples you may try in Mashup Editor for exception handling. | With <invoke> or <directinvoke>, you can use lightweight error handling outside of a <try> block by adding the onerror attribute. See Lightweight Error Handling for Component Mashups and Mashables for more information. Or, you can add onerror to <invoke> or <directinvoke> inside a <try> block to override any <catch> blocks. See for more information. |