HydraExpress User Guide : PART II The HydraExpress Agent : Chapter 7 Error Handling : Handling Exceptions
Handling Exceptions
This section provides specifics on the types of exceptions that can occur in HydraExpress and guidelines for how to handle them.
rwsf::Exception and its Derived Classes
Exceptions of rwsf::Exception or its derived classes fall in the following general categories:
General and XML exceptions, including allocation errors, external and internal errors, threading exceptions, and XML parsing errors.
Servlet and Web service-specific, such as WSDL exceptions and faults
Various network exceptions
It is generally preferable to catch the most specific exception possible, so that you can handle the exception gracefully and not mask other errors.
Other Possible Exceptions
Depending on the data mappings used in your application, exceptions other than rwsf::Exception may be thrown. For example, for services generated with default mappings and with the -STL option, message text is returned for exceptions derived from std::exception and rwsf::Exception, so you should be prepared to catch these exceptions. For -sourcepro generated services, message text is returned not only for std::exception and rwsf::Exception but also for RWxmsg, so there will be three types of exceptions your application will want to handle.
If you are using any custom datamapping via the -datamap option when generating code, you may have other exceptions that should be caught. For more information on this option, see “Creating Customized Mappings,” in the HydraExpress XML Binding Development Guide.