Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-2375

GemFireException should not inherit from RuntimeException

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • core, general

    Description

      GemFireException inherits from RuntimeException, which means that the majority of exceptions in Geode are unchecked. This means that we don't have the type system helping us to check potential failure conditions of our code, and it's not clear which functions may throw exceptions as a part of their nomal failure modes – for example, ReplyException has a handleAsUnexpected method that seems to indicate that a normal ReplyException is not unexpected – but that's not what the type inheritance says. GemFireException accounts for most of the exceptions in the codebase.

      Even if we were to convert most of the existing instances of GemFireException to GemFireRuntimeException, developers (especially new ones) would still be tempted to use GemFireException for new exceptions.

      Perhaps the best way to solve this (if we want all our exceptions to inherit from a central exception type, which I'm not entirely sold on) would be to create a new GeodeUncheckedException and GeodeCheckedException, and deprecate both kinds of GemFireException? Then we could convert old exceptions as time permits.

      There's a significant amount of work involved here whatever way we decide to change it.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              gosullivan Galen O'Sullivan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: