コード例 #1
0
ファイル: bsls_assert.cpp プロジェクト: Stackingit/bde
BSLS_ASSERT_NORETURN
void Assert::failThrow(const char *text, const char *file, int line)
{

#ifdef BDE_BUILD_TARGET_EXC
    if (!std::uncaught_exception()) {
        throw AssertTestException(text, file, line);
    }
    else {
        std::fprintf(stderr,
                "BSLS_ASSERTION ERROR: An uncaught exception is pending;"
                " cannot throw 'AssertTestException'.\n");
    }
#endif

    failAbort(text, file, line);
}
コード例 #2
0
ファイル: bsls_assert.cpp プロジェクト: jbrwilkinson/bde
BSLS_ASSERT_NORETURN
void Assert::failThrow(const char *text, const char *file, int line)
{

#ifdef BDE_BUILD_TARGET_EXC
    if (!std::uncaught_exception()) {
        throw AssertTestException(text, file, line);
    }
    else {
        bsls::Log::logMessage(bsls::LogSeverity::e_ERROR, file, line,
                "BSLS_ASSERT: An uncaught exception is pending;"
                " cannot throw 'AssertTestException'.");
    }
#endif

    failAbort(text, file, line);
}