Exemple #1
0
    std::string Exception::getErrorString() const
    {
        if (mError.getErrorId() >= RcfError_User)
        {
            std::ostringstream os;
            os << "Non-RCF error (" << mError.getErrorId() << ")";
            std::string w = getWhat();
            if (!w.empty())
            {
                os << ": " << w;
            }
            else
            {
                os << ".";
            }
            return os.str();
        }
        else if (mSubSystem == RcfSubsystem_Os)
        {
            std::ostringstream os;
            os << mError.getErrorString();

            if (mSubSystem == RcfSubsystem_Os)
            {
                os << " OS: " << mSubSystemError << " - " << getOsErrorString(mSubSystemError);
            }
            return os.str();
        }
        else
        {
            return mError.getErrorString();
        }
    }
Exemple #2
0
const char*
XBase::what() const
{
	if (m_what.empty()) {
		m_what = getWhat();
	}
	return m_what.c_str();
}
Exemple #3
0
BSONObj ChangeLogType::toBSON() const {
    BSONObjBuilder builder;

    if (_changeId)
        builder.append(changeId.name(), getChangeId());
    if (_server)
        builder.append(server.name(), getServer());
    if (_shard)
        builder.append(shard.name(), getShard());
    if (_clientAddr)
        builder.append(clientAddr.name(), getClientAddr());
    if (_time)
        builder.append(time.name(), getTime());
    if (_what)
        builder.append(what.name(), getWhat());
    if (_ns)
        builder.append(ns.name(), getNS());
    if (_details)
        builder.append(details.name(), getDetails());

    return builder.obj();
}