theshoeshiner commented on PR #1156: URL: https://github.com/apache/commons-lang/pull/1156#issuecomment-1887584608
So on the topic at hand - here's a question.. Say we want to ensure all listeners get the event, which I think is a reasonable feature, many other observable APIs have it (including apache commons). We begin by iterating through all listeners and collecting any checked exceptions. The interface event method signature is: `myEvent() throws CheckedException1, CheckedException2` Listener1 throws `CheckedException1`, Listener2 throws `CheckedException2` So, what kind of exception should the proxy invocation handler throw? The code im using as a bit of a guide, ObservableInputStream, doesn't have to deal with this problem. It only has to deal with IOException, and the IOExceptionList simply extends IOException. How do we force the caller to handle two different checked exceptions? We could wrap it in an `EventHandlerExceptionList` and throw that, but that violates the goal of not wrapping the checked exceptions in runtime exceptions. Should we force the caller to provide some kind of "onError" handler? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
