You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DataFetcherExceptionHandler. onException is both required and deprecated #2545
In the latest release, at this time 17.2, DataFetcherExceptionHandler's method onException is deprecated in favor of its async replacement handleException.
It seems you can't implement its replacement still needing to implement onException which leaves new code following the suggestion with a deprecation warning. What's the recommended path to migrating without deprecation warnings?
It seems you can't implement its replacement still needing to implement onException which leaves new code following the suggestion with a deprecation warning.
We had 2 choices - make a breaking change without deprecation -
PRO - its cleaner
CON - its breaks every one
or we could introduce a new method with a default implementation, deprecate the old
PRO - its less clean
CON - its breaks no one
Good Java library evolution does the latter choice.
SPIs (interfaces that so users have to implement) are the hardest to evolve btw
So yes you get an deprecation policy - but not broken. You should use the new method. At some future version where do DO remove the old method, less people will be affected
I think there is one more option, for DataFetcherExceptionHandler to add a default implementation of onException. This would not disrupt existing implementations and would allow migrating to handleException and dropping onException completely. Otherwise when onException is finally removed, it would trigger a wave of changes that can also cause issues.
Activity
bbakerman commentedon Sep 19, 2021
We had 2 choices - make a breaking change without deprecation -
PRO - its cleaner
CON - its breaks every one
or we could introduce a new method with a default implementation, deprecate the old
PRO - its less clean
CON - its breaks no one
Good Java library evolution does the latter choice.
SPIs (interfaces that so users have to implement) are the hardest to evolve btw
So yes you get an deprecation policy - but not broken. You should use the new method. At some future version where do DO remove the old method, less people will be affected
rstoyanchev commentedon Nov 17, 2021
I think there is one more option, for
DataFetcherExceptionHandlerto add a default implementation ofonException. This would not disrupt existing implementations and would allow migrating tohandleExceptionand droppingonExceptioncompletely. Otherwise whenonExceptionis finally removed, it would trigger a wave of changes that can also cause issues.