Previous Table of Contents Next


3.13.3 Raises Expressions


   There are two kinds of raises expressions as described in this section.

   3.13.3.1 Raises Expression

   A raises expression specifies which exceptions may be raised as a result of an invocation of the operation or accessing (invoking the _get operation of) a readonly attribute. The syntax for its specification is as follows:

   (93) <raises_expr> ::= “raises? “(? <scoped_name> { “,? <scoped_name> }∗ “)?

   The <scoped_name>s in the raises expression must be previously defined exceptions or native types. If a native type is used as an exception for an operation, the operation must appear in either a local interface or a valuetype.

   In addition to any operation-specific exceptions specified in the raises expression, there are a standard set of system exceptions that may be signalled by the ORB. These standard system exceptions are described in Section 4.12.3, “Standard System Exception Definitions,? on page 4-66. However, standard system exceptions may not be listed in a raises expression.

   The absence of a raises expression on an operation implies that there are no operation-specific exceptions. Invocations of such an operation are still liable to receive one of the standard system exceptions.

   3.13.3.2 getraises and setraises Expressions

   getraises and setraises expressions specify which exceptions may be raised as a result of an invocation of the accessor (_get) and a mutator (_set) functions of an attribute. The syntax for its specification is as follows:

   (108) <attr_raises_expr> ::= <get_excep_expr> [ <set_excep_expr> ] | <set_excep_expr>

   (109) <get_excep_expr> ::= “getraises? <exception_list>

   (110) <set_excep_expr> ::= “setraises? <exception_list>

   (111) <exception_list ::= “(? <scoped_name> { “,? <scoped_name> } * “)?

   The <scoped_name>s in the getraises and setraises expressions must be previously defined exceptions.

   In addition to any attribute-specific exceptions specified in the getraises and setraises expressions, there are a standard set of exceptions that may be signalled by the ORB. These standard exceptions are described in Section 4.12.3, “Standard System Exception Definitions,? on page 4-66. However, standard exceptions may not be listed in a getraises or setraises expression.

   The absence of a getraises or setraises expression on an attribute implies that there are no accessor-specific or mutator-exceptions respectively. Invocations of such an accessor or mutator are still liable to receive one of the standard exceptions.

   Note – The exceptions associated with the accessor operation corresponding to a readonly attribute is specified using a simple raises expression as specified in Section 3.13.3.1, “Raises Expression,? on page 3-52 . The getraises and setraises expressions are used only in attributes that are not readonly.