Exceptions can be declared in a module or interface. Exceptions are declared as follows:
exception name { ... memberList ... };
where name is the name of the exception and memberList is an optional list of member field declarations. This list has the form:
exception MyException { type1 member1; type2 member2; ... };
Where type1, type2, and so forth are IDL type names (other than CORBA::Any) and member1, member2, and so forth are the names of the member fields.
Once you have defined an exception, you can use it in the raises clause when defining operations for an interface, as described in “Operation declarations”.