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

            if (mSubSystem == RcfSubsystem_Os)
            {
                os << " OS: " << mSubSystemError << " - " << getOsErrorString(mSubSystemError);
            }
            return os.string();
        }
        else
        {
            return mError.getErrorString();
        }
    }
Exemplo n.º 2
0
 std::string HttpsEndpoint::asString() const
 {
     MemOstream os;
     std::string ip = getIp();
     if (ip.empty())
     {
         ip = "127.0.0.1";
     }
     os << "HTTPS endpoint " << ip << ":" << getPort();
     return os.string();
 }
Exemplo n.º 3
0
    std::string Exception::translate() const
    {
        std::string osErr;
        if (mSubSystem == RcfSubsystem_Os)
        {
            osErr = getOsErrorString(mSubSystemError);
        }

        int errorId = mError.getErrorId();

        MemOstream os;
        os
            << "[" << errorId << ": " << getErrorString() << "]"
            << "[" << mSubSystem << ": " << RCF::getSubSystemName(mSubSystem) << "]"
            << "[" << mSubSystemError << ": " << osErr << "]"
            << "[What: " << mWhat << "]"
            << "[Context: " << mContext << "]";
        return os.string();
    }
Exemplo n.º 4
0
 std::string UdpEndpoint::asString() const
 {
     MemOstream os;
     os << "UDP endpoint " << mIp.string();
     return os.string();
 }