Skip to content

DataFetcherExceptionHandler. onException is both required and deprecated #2545

Closed

Description

@softprops

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?

Activity

  1. bbakerman commented on Sep 19, 2021

    @bbakerman
    Member

    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

  2. rstoyanchev commented on Nov 17, 2021

    @rstoyanchev

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions