3 Replies Latest reply on Mar 9, 2015 1:01 PM by Christian Sadilek

    Errai-Bus and client side error handling

    Uemit Seren Newbie

      I am using Errai-Bus 3.1.2.Final in a GWT applicaiton and I have troubles getting the client side error handling to work.


      Here is the setup:

      I am trying to send a Message to the backend:


      Date date = new Date();





           .errorsHandledBy(new ErrorCallback<Message>() {

                      public boolean error(Message o, Throwable throwable) {

                         return true;





      On the backend I have a MessageCallback and for testing purposes I throw a custom SessionTimeOutException (which is in the -shared package that can be accessed by both the GWT client and backend):




      public class Hearbeat implements MessageCallback {


         public void callback(Message message) {

               throw new SessionTimeOutException();




      public class SessionTimeOutException extends RuntimeException {



      I added this lien to the ErraiApp.properties:





      However my custom ErrorCallback is never called. Instead my global uncaughtExceptionHandler is called with a JavascriptException (""Cannot read property 'stringValue_3_g$' of null"")


      So there are two issues here:


      1.) My custom ErrorCallback is not called

      2.) My custom Exception does not get sent to the client.


      I would be thankful for any advice.



      The exception ""Cannot read property 'stringValue_3_g$' of null"" is due to the fact that I create an Exception without a message.

      This seems to be a bug in the ErraiProtcolEnvelopeMarshaller.java.

      This line will throw a null pointer exception when there is no message


      After changing this to a non null message, instead of a JavascriptException a normal Exception is thrown


      After moving the ErraiApp.properties file to the client side package, my custom exception is properly sent to the client.