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:

1

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

2

Catches a ExecutionException exception.

3

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...