Commit 5d0e40cd authored by Andrew Mitchell's avatar Andrew Mitchell
Browse files

Added REMOTE_NESTED_OPERATION_ERRORS Status code to match protocol

parent 7f69cfc1
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -50,7 +50,8 @@ enum class StatusCode {
    REMOTE_NO_SPACE,
    REMOTE_NO_SUCH_HMAC_ALGORITHM,
    REMOTE_OTHER_ERROR,
    PROTOCOL_ERROR_RESPONSE_NO_ACKSEQUENCE
    PROTOCOL_ERROR_RESPONSE_NO_ACKSEQUENCE,
    REMOTE_NESTED_OPERATION_ERRORS
};

StatusCode ConvertFromProtoStatus(Message_Status_StatusCode status);
+2 −0
Original line number Diff line number Diff line
@@ -68,6 +68,8 @@ KineticStatus GetKineticStatus(StatusCode code, int64_t expected_cluster_version
            return KineticStatus(code, "No space left");
        case StatusCode::REMOTE_NO_SUCH_HMAC_ALGORITHM:
            return KineticStatus(code, "Unknown HMAC algorithm");
        case StatusCode::REMOTE_NESTED_OPERATION_ERRORS:
            return KineticStatus(code, "Operation completed but has nested errors");
        default:
            return KineticStatus(code, "Internal Error");
    }
+5 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ using com::seagate::kinetic::client::proto::Message_Status_StatusCode_REMOTE_CON
using com::seagate::kinetic::client::proto::Message_Status_StatusCode_NO_SPACE;
using com::seagate::kinetic::client::proto::Message_Status_StatusCode_NO_SUCH_HMAC_ALGORITHM;
using com::seagate::kinetic::client::proto::Message_Status_StatusCode_INVALID_REQUEST;
using com::seagate::kinetic::client::proto::Message_Status_StatusCode_NESTED_OPERATION_ERRORS;

StatusCode ConvertFromProtoStatus(Message_Status_StatusCode status) {
    switch (status) {
@@ -77,6 +78,8 @@ StatusCode ConvertFromProtoStatus(Message_Status_StatusCode status) {
            return StatusCode::REMOTE_INVALID_REQUEST;
        case Message_Status_StatusCode_INVALID_STATUS_CODE:
            return StatusCode::CLIENT_INTERNAL_ERROR;
        case Message_Status_StatusCode_NESTED_OPERATION_ERRORS:
            return StatusCode::REMOTE_NESTED_OPERATION_ERRORS;
        default:
            return StatusCode::REMOTE_OTHER_ERROR;
    }
@@ -116,6 +119,8 @@ Message_Status_StatusCode ConvertToProtoStatus(StatusCode status) {
            return Message_Status_StatusCode_NO_SUCH_HMAC_ALGORITHM;
        case StatusCode::REMOTE_INVALID_REQUEST:
            return Message_Status_StatusCode_INVALID_REQUEST;
        case StatusCode::REMOTE_NESTED_OPERATION_ERRORS:
            return Message_Status_StatusCode_NESTED_OPERATION_ERRORS;
        default:
            return Message_Status_StatusCode_INTERNAL_ERROR;
    }