Skip to content

Conversation

@bbakerman
Copy link
Member

See #2545

@bbakerman bbakerman added this to the 18.0 milestone Nov 18, 2021
DataFetcherExceptionHandlerResult onException(DataFetcherExceptionHandlerParameters handlerParameters);
default DataFetcherExceptionHandlerResult onException(DataFetcherExceptionHandlerParameters handlerParameters) {
return SimpleDataFetcherExceptionHandler.defaultImpl.onException(handlerParameters);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we undefault the other method in this same PR (and hence 18.0 version)?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to keep default implementation on the new method or otherwise existing implementations would not work until they implement it.

DataFetcherExceptionHandlerResult onException(DataFetcherExceptionHandlerParameters handlerParameters);
default DataFetcherExceptionHandlerResult onException(DataFetcherExceptionHandlerParameters handlerParameters) {
return SimpleDataFetcherExceptionHandler.defaultImpl.onException(handlerParameters);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to keep default implementation on the new method or otherwise existing implementations would not work until they implement it.

@Deprecated
DataFetcherExceptionHandlerResult onException(DataFetcherExceptionHandlerParameters handlerParameters);
default DataFetcherExceptionHandlerResult onException(DataFetcherExceptionHandlerParameters handlerParameters) {
return SimpleDataFetcherExceptionHandler.defaultImpl.onException(handlerParameters);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't this be just IllegalStateException? Either a class implements the new method, in which case this is not used, or it overrides this one. Either way this implementation should never be called.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is more when do we decide to break older implementers. if the new CF based handleException does not call the older onException then every one out there that previous implemented onException will break. Because our code will call their method.

Do really it's a case of deciding WHEN we break backwards compat in behavior. That is all those old onException methods will stop working even if its deprecrated.

So ... should that be now? This new CF based method was introduced in 17.x - 18.x is next. Is one version enough? I kinda think it should be two versions

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to clarify, the new handleException should continue to call onException as it does now. I'm not suggesting otherwise. I'm not sure how long the deprecation period should continue, but I see no reason not to give it ample time. When that's over, drop onException and remove the the default implementation from handleException.

@bbakerman bbakerman merged commit 4238a16 into master Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants