2

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.

LOG_TAG
  • 19,894
  • 12
  • 72
  • 105
fweigl
  • 21,278
  • 20
  • 114
  • 205

1 Answers1

4

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.

lobzik
  • 10,974
  • 1
  • 27
  • 32