GreenRobot EventBus crash app

931 views Asked by At

I use GreenRobot's EventBus all over my app and love it. When I use a method like

public void onEventMainThread(SearchStartedEvent e) {

    doThis();

}

and in doThis() there is an Exception like a NPE, the App won't crash but EventBus will Log.e() the exception. Can I configure EventBus so it will actually crash my App? That would make debugging easier for me.

1

There are 1 answers

0
lobzik On BEST ANSWER

Instance of SubscriberExceptionEvent is posted by EventBus when an exception occurs inside a subscriber's event handling method. You can implement method

public void onEvent(SubscriberExceptionEvent exceptionEvent) {
     yourHandlingMethod(exceptionEvent.throwable);
}

and handle any thrown exception.