Skip to content

Error being undetected by the SubscriberExceptionHandler #7728

Open
@Jiabao-Sun

Description

@Jiabao-Sun

API(s)

`com.google.common.eventbus.Subscriber#dispatchEvent`

How do you want it to be improved?

  final void dispatchEvent(final Object event) {
    executor.execute(
        new Runnable() {
          @Override
          public void run() {
            try {
              invokeSubscriberMethod(event);
            } catch (InvocationTargetException e) {
              bus.handleSubscriberException(e.getCause(), context(event));
            } catch(Throwable e) {
              bus.handleSubscriberException(e, context(event));
            }
          }
        });
  }

Why do we need it to be improved?

The Subscriber#dispatchEvent did not catch Throwable, resulting in the Error being undetected by the SubscriberExceptionHandler

Example

-

Current Behavior

Desired Behavior

Error can be detected by the SubscriberExceptionHandler

Concrete Use Cases

Checklist

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions