[SERVER-17850] add utility function for converting an exception to a Status Created: 01/Apr/15  Updated: 18/Sep/15  Resolved: 03/Apr/15

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 3.1.1

Type: Improvement Priority: Major - P3
Reporter: Adam Midvidy Assignee: Adam Midvidy
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Platform 1 04/03/15
Participants:

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



 Comments   
Comment by Githook User [ 03/Apr/15 ]

Author:

{u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}

Message: SERVER-17850 add utility to convert an exception to a Status
Branch: master
https://github.com/mongodb/mongo/commit/78aa03b4eda2784ae67eba32d6b103166f1c57ad

Comment by Adam Midvidy [ 03/Apr/15 ]

this seems to cause base_test to hang on some platforms on MCI, though I haven't been able to repro on a spawnhost. Going to revert regardless.

Comment by Githook User [ 03/Apr/15 ]

Author:

{u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}

Message: Revert "SERVER-17850 add utility to convert an exception to a Status"

This reverts commit cef8caf626f97d6e92056066d9c6fd3479185f06.
Branch: master
https://github.com/mongodb/mongo/commit/42bb8806932f9cee219924df6d62745439ecb4e4

Comment by Githook User [ 02/Apr/15 ]

Author:

{u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}

Message: SERVER-17850 add utility to convert an exception to a Status
Branch: master
https://github.com/mongodb/mongo/commit/cef8caf626f97d6e92056066d9c6fd3479185f06

Generated at Thu Feb 08 03:45:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.