std::string Status::CodeAsString()

in src/kudu/util/status.cc [44:110]


std::string Status::CodeAsString() const {
  if (state_ == nullptr) {
    return "OK";
  }

  const char* type;
  switch (code()) {
    case kOk:
      type = "OK";
      break;
    case kNotFound:
      type = "Not found";
      break;
    case kCorruption:
      type = "Corruption";
      break;
    case kNotSupported:
      type = "Not implemented";
      break;
    case kInvalidArgument:
      type = "Invalid argument";
      break;
    case kIOError:
      type = "IO error";
      break;
    case kAlreadyPresent:
      type = "Already present";
      break;
    case kRuntimeError:
      type = "Runtime error";
      break;
    case kNetworkError:
      type = "Network error";
      break;
    case kIllegalState:
      type = "Illegal state";
      break;
    case kNotAuthorized:
      type = "Not authorized";
      break;
    case kAborted:
      type = "Aborted";
      break;
    case kRemoteError:
      type = "Remote error";
      break;
    case kServiceUnavailable:
      type = "Service unavailable";
      break;
    case kTimedOut:
      type = "Timed out";
      break;
    case kUninitialized:
      type = "Uninitialized";
      break;
    case kConfigurationError:
      type = "Configuration error";
      break;
    case kIncomplete:
      type = "Incomplete";
      break;
    case kEndOfFile:
      type = "End of file";
      break;
  }
  return std::string(type);
}