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

add utility function for converting an exception to a Status

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1.1
    • Component/s: Internal Code
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Platform 1 04/03/15

      Description

      i.e. a Lippincott function

      example

      Status myFunc() {
          try {
              funcThatThrows();
              return Status::OK();
          } catch (...) {
             return ExceptionToStatus();
          }
      }
      

      Then ExceptionToStatus() looks like:

      Status ExceptionToStatus() {
          try {
              throw;
          } catch (const DBException& ex) {
             return Status(...)
          } catch (const std::exception& ex) {
              .....
          }
          .....
      }
      

        Attachments

          Activity

            People

            Assignee:
            adam.midvidy Adam Midvidy
            Reporter:
            adam.midvidy Adam Midvidy
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: