This content has been marked as final. Show 1 reply
Let me try and break the error callback down for you:
- The SignupService is annotated with @Remote, so it uses Errai Bus. Consequently, it needs a BusErrorCallback.
- The error method of the BusErrorCallback is where your error handling goes. In this example, a Label on the page has an error message added to it and then is made visible.
- The error method returns false because we do not want this error to propogate to the global uncaught exception handlers.
- The whole RPC call is in a try/catch block because the SignupService.register method throws a checked exception (RegistrationException).
- But, the checked exception will never be caught at line 102 because line 100 is invoking an RPCStub that triggers an asynchronous call. That's why all your error logic goes in the error callback.
I hope that's cleared things up.