LibraryToggle FramesPrintFeedback

Example 18.11 shows an example of catching an exception using the polling approach.

The code in Example 18.11 does the following:


Wraps the call to the Response<T> object's get() method in a try/catch block.


Catches a ExecutionException exception.


Extracts the cause field from the exception.

If the consumer was using the callback approach the code used to catch the exception would be placed in the callback object where the service's response is extracted.

Comments powered by Disqus
loading table of contents...