ICCItem *CCodeChain::CreateError (const CString &sError, ICCItem *pData) // CreateError // // Creates an item // // sError: Error messages // pData: Item that caused error. { ICCItem *pError; CString sArg; CString sErrorLine; // Convert the argument to a string if (pData) { sArg = pData->Print(this); sErrorLine = strPatternSubst(LITERAL("%s [%s]"), sError, sArg); } else sErrorLine = sError; // Create the error pError = CreateString(sErrorLine); pError->SetError(); return pError; }
ICCItem *CCodeChain::CreateSystemError (ALERROR error) // CreateSystemError // // Generates an error { ICCItem *pError; pError = CreateString(strPatternSubst(LITERAL("ERROR: %d"), error)); pError->SetError(); return pError; }
ICCItem *CCodeChain::CreateErrorCode (int iErrorCode) // CreateError // // Creates an item // // iErrorCode: Error code (CCRESULT_???) { ICCItem *pError; pError = CreateInteger(iErrorCode); pError->SetError(); return pError; }