XRT icon indicating copy to clipboard operation
XRT copied to clipboard

ert_cmd_state to_string

Open wilderfield opened this issue 1 year ago • 0 comments

Can we add a utility like this somewhere?

Use case is reporting / printing errors when run.wait() fails.

std::string to_string(ert_cmd_state state)
{
    switch(state) {
        case ERT_CMD_STATE_NEW: return "NEW";
        case ERT_CMD_STATE_QUEUED: return "QUEUED";
        case ERT_CMD_STATE_RUNNING: return "RUNNING";
        case ERT_CMD_STATE_COMPLETED: return "COMPLETED";
        case ERT_CMD_STATE_ERROR: return "ERROR";
        case ERT_CMD_STATE_ABORT: return "ABORT";
        case ERT_CMD_STATE_SUBMITTED: return "SUBMITTED";
        case ERT_CMD_STATE_TIMEOUT: return "TIMEOUT";
        case ERT_CMD_STATE_NORESPONSE: return "NORESPONSE";
        case ERT_CMD_STATE_SKERROR: return "SKERROR";
        case ERT_CMD_STATE_SKCRASHED: return "SKCRASHED";
        default: return "UNKNOWN";
    }
}

wilderfield avatar May 05 '23 18:05 wilderfield