当前位置: 首页>>代码示例>>C++>>正文


C++ ErrorInfo类代码示例

本文整理汇总了C++中ErrorInfo的典型用法代码示例。如果您正苦于以下问题:C++ ErrorInfo类的具体用法?C++ ErrorInfo怎么用?C++ ErrorInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ErrorInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ErrorInfo

ItemReaderResult ItemReader::internalReadFile(const QString &filePath)
{
    ASTCacheValue &cacheValue = (*m_astCache)[filePath];
    if (cacheValue.isValid()) {
        if (Q_UNLIKELY(cacheValue.isProcessing()))
            throw ErrorInfo(Tr::tr("Loop detected when importing '%1'.").arg(filePath));
    } else {
        QFile file(filePath);
        if (Q_UNLIKELY(!file.open(QFile::ReadOnly)))
            throw ErrorInfo(Tr::tr("Cannot open '%1'.").arg(filePath));

        m_filesRead.insert(filePath);
        const QString code = QTextStream(&file).readAll();
        QbsQmlJS::Lexer lexer(cacheValue.engine());
        lexer.setCode(code, 1);
        QbsQmlJS::Parser parser(cacheValue.engine());

        file.close();
        if (!parser.parse()) {
            QList<QbsQmlJS::DiagnosticMessage> parserMessages = parser.diagnosticMessages();
            if (Q_UNLIKELY(!parserMessages.isEmpty())) {
                ErrorInfo err;
                foreach (const QbsQmlJS::DiagnosticMessage &msg, parserMessages)
                    err.append(msg.message, toCodeLocation(filePath, msg.loc));
                throw err;
            }
        }
开发者ID:AtlantisCD9,项目名称:Qt,代码行数:27,代码来源:itemreader.cpp

示例2: generate

void ClangCompilationDatabaseGenerator::generate()
{
    for (const Project &theProject : project().projects.values()) {
        QJsonArray database;
        const ProjectData projectData = theProject.projectData();
        const QString buildDir = projectData.buildDirectory();

        for (const ProductData &productData : projectData.allProducts()) {
            for (const GroupData &groupData : productData.groups()) {
                for (const ArtifactData &sourceArtifact : groupData.allSourceArtifacts()) {
                    if (!hasValidInputFileTag(sourceArtifact.fileTags()))
                        continue;

                    const QString filePath = sourceArtifact.filePath();
                    ErrorInfo errorInfo;
                    const RuleCommandList rules = theProject.ruleCommands(productData, filePath,
                                                                       QStringLiteral("obj"),
                                                                       &errorInfo);

                    if (errorInfo.hasError())
                        throw errorInfo;

                    for (const RuleCommand &rule : rules) {
                        if (rule.type() != RuleCommand::ProcessCommandType)
                            continue;
                        database.append(createEntry(filePath, buildDir, rule));
                    }
                }
            }
        }

        writeProjectDatabase(QDir(buildDir).filePath(DefaultDatabaseFileName), database);
    }
}
开发者ID:,项目名称:,代码行数:34,代码来源:

示例3: CreateError

cpix_Error * CreateError(cpix_ErrorType    errorType,
                         const char      * msg)
{
    ErrorInfo
        * errorInfo = NULL;

    try
        {
            errorInfo = AcquireErrorInfo();
            errorInfo->setInfo(errorType,
                               msg);
        }
    catch (...)
        {
            logMsg(CPIX_LL_ERROR,
                   "!!! Failed to create error struct for type %d ...",
                   errorType);
            logMsg(CPIX_LL_ERROR,
                   "!!! ... (cont'd) msg: %s. Will report CPIX error.",
                   msg == NULL ? "(null)" : msg);

            errorInfo = & SyncErrorInfo;
            errorInfo->setInfo(ET_CPIX_EXC);
        }

    cpix_Error
        * rv = static_cast<cpix_Error*>(errorInfo);

    return rv;
}
开发者ID:kuailexs,项目名称:symbiandump-mw3,代码行数:30,代码来源:cpixerror.cpp

示例4: BuildGraphLocker

void InternalSetupProjectJob::start()
{
    BuildGraphLocker *bgLocker = m_existingProject ? m_existingProject->bgLocker : 0;
    try {
        const ErrorInfo err = m_parameters.expandBuildConfiguration();
        if (err.hasError())
            throw err;
        const QString projectId = TopLevelProject::deriveId(m_parameters.topLevelProfile(),
                m_parameters.finalBuildConfigurationTree());
        const QString buildDir
                = TopLevelProject::deriveBuildDirectory(m_parameters.buildRoot(), projectId);
        if (m_existingProject && m_existingProject->buildDirectory != buildDir)
            m_existingProject.clear();
        if (!m_existingProject) {
            bgLocker = new BuildGraphLocker(ProjectBuildData::deriveBuildGraphFilePath(buildDir,
                                                                                       projectId),
                                            logger());
        }
        execute();
        if (m_existingProject)
            m_existingProject->bgLocker = 0;
        m_newProject->bgLocker = bgLocker;
    } catch (const ErrorInfo &error) {
        m_newProject.clear();
        setError(error);
        if (!m_existingProject)
            delete bgLocker;
    }
    emit finished(this);
}
开发者ID:Distrotech,项目名称:qbs,代码行数:30,代码来源:internaljobs.cpp

示例5: ErrorInfoCreate

ErrorInfo ErrorInfoCreate(ErrorInfo::Error error, EModule module, int line) {
    ErrorInfo info;
    info.set_error(error);
    info.set_module(module);
    info.set_line(line);
    return info;
}
开发者ID:rstone,项目名称:ld28,代码行数:7,代码来源:error.cpp

示例6: testCallingSequence1

void testCallingSequence1(uima::util::ConsoleUI& rclConsole, const TCHAR* cpszConfigFilename)
/* ----------------------------------------------------------------------- */
{
    ErrorInfo errInfo;
    uima::TextAnalysisEngine* pEngine = TextAnalysisEngine::createTextAnalysisEngine(cpszConfigFilename, errInfo);

    failIfNotTrue(errInfo.getErrorId() == UIMA_ERR_NONE);
    failIfNotTrue(pEngine != NULL);
    CAS* cas = pEngine->newCAS();
    failIfNotTrue(cas != NULL);

    uima::UnicodeStringRef us(UnicodeString("a"));
//   UnicodeStringRef uRef(us);
    rclConsole.formatHeader(_TEXT("testing Engine CallingSequence1"));

    cas->setDocumentText(us.getBuffer(), us.length());
    cas->getDocumentAnnotation().setLanguage("en");
    failIfNotTrue(pEngine->process(*cas) == UIMA_ERR_NONE);
    failIfNotTrue(cas->reset() == UIMA_ERR_NONE);
    failIfNotTrue(pEngine->destroy() == UIMA_ERR_NONE);

    cas->setDocumentText(us.getBuffer(), us.length());
    cas->getDocumentAnnotation().setLanguage("en");
    failIfNotTrue(pEngine->process(*cas) == UIMA_ERR_ENGINE_INVALID_CALLING_SEQUENCE);

    TyErrorId deInitRC = pEngine->destroy();
    rclConsole.format("RC of deInit()", deInitRC);
    failIfNotTrue(deInitRC == UIMA_ERR_ENGINE_INVALID_CALLING_SEQUENCE);
    rclConsole.formatBool(_TEXT("testing Engine CallingSequence1 OK"),
                          true);  //lint !e944: argument for operator '!' always evaluates to False
    delete cas;
    delete pEngine;
}  //lint !e715: cpszConfigFilename (line 99) not referenced
开发者ID:mathtexts,项目名称:uimacpp,代码行数:33,代码来源:test_engine.cpp

示例7: PNGWarning

static void PNGWarning(png_structp png, png_const_charp message)
{
	ErrorInfo *errorInfo = png_get_error_ptr(png);
	if (errorInfo != NULL && errorInfo->errorCB != NULL)
	{
		errorInfo->errorCB(message, false, errorInfo->errorCBContext);
	}
}
开发者ID:BackupTheBerlios,项目名称:oolite-linux-svn,代码行数:8,代码来源:FPMPNG.c

示例8: productsToUse

void CommandLineFrontend::dumpNodesTree()
{
    QFile stdOut;
    stdOut.open(stdout, QIODevice::WriteOnly);
    const ErrorInfo error = m_projects.front().dumpNodesTree(stdOut, productsToUse()
                                                             .value(m_projects.front()));
    if (error.hasError())
        throw error;
}
开发者ID:qt-labs,项目名称:qbs,代码行数:9,代码来源:commandlinefrontend.cpp

示例9: CheckError

/* Similar routine as above just with error info objects instead of err-ids.
This routine just does a hard program exit for any failure!
*/
static void CheckError(ErrorInfo const &errInfo) {
    if (errInfo.getErrorId() != UIMA_ERR_NONE) {
        cerr << endl << "   *** ExampleApplication - Error info:" << endl
        << "Error string  : "
        << AnalysisEngine::getErrorIdAsCString(errInfo.getErrorId())
        << errInfo << endl;                      /* (errInfo starts with a newline) */
        exit((int) errInfo.getErrorId());
    }
}
开发者ID:mathtexts,项目名称:uimacpp,代码行数:12,代码来源:ExampleApplication.cpp

示例10: QBS_CHECK

void CommandLineFrontend::generate()
{
    QBS_CHECK(!!m_generator);
    const ErrorInfo error = m_generator->generate(m_projects,
                                                  m_parser.buildConfigurations(),
                                                  m_parser.installOptions(QString()),
                                                  m_parser.settingsDir(),
                                                  ConsoleLogger::instance(m_settings));
    if (error.hasError())
        throw error;
}
开发者ID:qt-labs,项目名称:qbs,代码行数:11,代码来源:commandlinefrontend.cpp

示例11: testDescriptorNotFound

void testDescriptorNotFound(uima::util::ConsoleUI& rclConsole)
/* ----------------------------------------------------------------------- */
{
    rclConsole.info("testDescriptorNotFound start.");
    uima::TextAnalysisEngine* pEngine;

    ErrorInfo errInfo;
    pEngine = TextAnalysisEngine::createTextAnalysisEngine(_TEXT("DUMMY"), errInfo);
    failIfNotTrue(errInfo.getErrorId() == UIMA_ERR_RESOURCE_CORRUPTED);
    failIfNotTrue(pEngine == NULL);
    rclConsole.info("testDescriptorNotFound finished.");
}
开发者ID:mathtexts,项目名称:uimacpp,代码行数:12,代码来源:test_engine.cpp

示例12: testMissingResMgr

void testMissingResMgr(uima::util::ConsoleUI& rclConsole)
/* ----------------------------------------------------------------------- */
{
    rclConsole.info("testMissingResMgr start.");
    uima::TextAnalysisEngine* pEngine;

    failIfNotTrue(!ResourceManager::hasInstance());
    ErrorInfo errInfo;
    pEngine = TextAnalysisEngine::createTextAnalysisEngine(_TEXT("DUMMY"), errInfo);
    failIfNotTrue(!ResourceManager::hasInstance());
    failIfNotTrue(errInfo.getErrorId() == UIMA_ERR_ENGINE_RESMGR_NOT_INITIALIZED);
    failIfNotTrue(pEngine == NULL);
    rclConsole.info("testMissingResMgr finished.");
}
开发者ID:mathtexts,项目名称:uimacpp,代码行数:14,代码来源:test_engine.cpp

示例13: get

            static
            typename ErrorInfo::value_type *
            get( exception const & x )
                {
                if( exception_detail::error_info_container * c=x.data_.get() )
                    if( shared_ptr<exception_detail::error_info_base> eib = c->get(BOOST_EXCEPTION_STATIC_TYPEID(ErrorInfo)) )
                        {
#ifndef BOOST_NO_RTTI
                        BOOST_ASSERT( 0!=dynamic_cast<ErrorInfo *>(eib.get()) );
#endif
                        ErrorInfo * w = static_cast<ErrorInfo *>(eib.get());
                        return &w->value();
                        }
                return 0;
                }
开发者ID:AsherBond,项目名称:PDAL,代码行数:15,代码来源:get_error_info.hpp

示例14: RecordErrorInfo

// [R]
void CompileSession::RecordErrorInfo(const ErrorInfo& templ) {
  DEBUG_FORMAT("%s", templ);

  static bool fContinue = false;
  if (!fContinue && ::IsDebuggerPresent()) {
    __debugbreak();
    fContinue = true;
  }

  if (error_set_.Contains(&templ)) {
    return;
  }

  auto& error_info = templ.Clone();

  error_set_.Add(&error_info);

  auto ref = errors_.GetLast();
  while (ref) {
    if (error_info.source_info() > ref->source_info()) {
      break;
    }
    ref = ref->GetPrev();
  }
  if (ref) {
    errors_.InsertAfter(&error_info, ref);
  } else {
    errors_.Prepend(&error_info);
  }
}
开发者ID:eval1749,项目名称:evm,代码行数:31,代码来源:CompileSession.cpp

示例15: testCallingSequence2

void testCallingSequence2(uima::util::ConsoleUI& rclConsole, const TCHAR* cpszConfigFilename)
/* ----------------------------------------------------------------------- */
{
    rclConsole.formatHeader(_TEXT("testing Engine CallingSequence2"));
    {

        uima::TextAnalysisEngine* pEngine = NULL;
        ErrorInfo errInfo;

        pEngine = TextAnalysisEngine::createTextAnalysisEngine(cpszConfigFilename, errInfo);
        failIfNotTrue(errInfo.getErrorId() == UIMA_ERR_NONE);
        failIfNotTrue(pEngine != NULL);
        delete pEngine;
    }
    rclConsole.formatBool(_TEXT("testing Engine CallingSequence2 OK"),
                          true);  //lint !e944: argument for operator '!' always evaluates to False
}
开发者ID:mathtexts,项目名称:uimacpp,代码行数:17,代码来源:test_engine.cpp


注:本文中的ErrorInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。