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

add utility function for converting an exception to a Status

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.1
    • Affects Version/s: None
    • Component/s: Internal Code
    • Labels:
      None
    • Fully Compatible
    • Platform 1 04/03/15

      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) {
              .....
          }
          .....
      }
      

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

              Created:
              Updated:
              Resolved: