Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-38368

Allow handling ErrorCategory types for Futures error handling

    XMLWordPrintable

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.1.8
    • Concurrency
    • None
    • Fully Compatible
    • Service Arch 2019-01-28, Service Arch 2019-02-11

    Description

      In the same way we allow

      myFuture
        .onError<SomeErrorCode>(/ * Handle this type of error */ )
        .onError<SomeOtherCode>(/* Handle other type of error */)
        .onError(/* handle all other errors */)
      

      it would be nice to have a way to do this with ErrorCategory types, like ShutdownError, since frequently these all need to be handled the same way.

      E.g.

      myFuture
        .onError<SomeErrorCode>(/ * Handle this type of error */ )
        .onError<SomeOtherCode>(/* Handle other type of error */)
        .onErrorCategory<ErrorCategory::ShutdownError>(/* Handle error for which isShutdownError(code) is true */)
        .onError(/* handle all other errors */)
      

      Attachments

        Activity

          People

            jonathan.ma@mongodb.com Jonathan Ma
            matthew.saltz@mongodb.com Matthew Saltz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: