beautypg.com

Exceptions, Exceptions 21 – Google Apps Security and Compliance Services Web Services Application Programming Interface Guide, Early Access Version 1.5 User Manual

Page 24

background image

API Infrastructure

21

Note:

Operation-level exceptions are the most common exceptions. Handle

these exceptions when the operation is called, and not at the top of the
application.

Mixed levels of exceptions -- Occasionally a condition occurs causing
different types of exceptions to be thrown at the same time. The application’s
behavior is subject to the most severe exception.

Programming languages and IDEs -- Different languages and IDE tool
environments represent and handle and parse exception input and output
differently. For example:

For .NET and C# applications, the SOAPException is used. Specific
exceptions are not required to be explicitly caught. Even though an
application may be forced to stop running later, exceptions are allowed to
not be explicitly handled in the code.

For Java applications, an exception name has to be explicitly in the code
or the application can not be compiled successfully.

It is strongly recommended that your web service application handle
exceptions explicitly in the code.

Note:

Other web service enabled languages and tools have different exception

handling strategies. Refer to the language or IDE documentation for more
information.

Exceptions

When handling exceptions, use the exception name. Any exception strings should
not be used to identify an exception. These are for a developer’s reference only.
These strings are subject to change across releases.

General API Infrastructure Exceptions Common to the APIs

AdminBlockException -- An email security service administrative block of an
application, a login ID, or an IP address. This block can be permanent or
temporary. This exception should stop the running of the application.

Recommended Solution

-- During the Early Access program, send mail to the

Early Access Program’s support, [email protected] to open a
case via email.

AuthenticationException -- The login credentials are not valid. For example,
when an administrator, configured for PMP authentication, uses an xauth
password, the system returns an AuthenticationException.

Recommended Solution

-- Abort the operation, and ask for the correct login

credentials.

InternalException -- Known email security service internal event, such as the
XML would not validate.