The client framework supports throwing exceptions through
the use of exception classes. The Error class has a series of methods that can
be thrown. For instance, if a parameter of a method is null, the following
exception can be thrown:
Listing 18
throw new Error.argumentNull("value", "The value was null");
It's also possible to create custom exceptions; after all,
an exception is a class object. Many exception objects already exist in the
framework, and so you have some options. In case that doesn't suite you, it's
possible to create your own and expose them from the Error class. How to do that
is out of scope for the article.