/
uzer_007
/
reindexer
Обзор
Документация
Войти
/
uzer_007
/
reindexer
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
cpp_src/tools/assertrx.cc
27 строк
994 B
madschemas
Update to version v5.3.0
27 май 2025, 09:19
27 май 2025, 09:19
df43703
Код
Авторство
О чём код?
#include "assertrx.h" #include <cstdio> #include <cstdlib> #include <iostream> #include "debug/backtrace.h" #include "fmt/format.h" #include "tools/errors.h" namespace reindexer { // NOLINTNEXTLINE(bugprone-exception-escape) Exception does not matter here - we are going to crash anyway void fail_assertrx(const char* assertion, const char* file, unsigned line, const char* function) noexcept { auto msg = fmt::format("Assertion failed: {} ({}:{}: {})", assertion, file, line, function); std::cerr << msg << "\n"; debug::backtrace_set_assertion_message(std::move(msg)); debug::print_crash_query(std::cerr); std::abort(); } void fail_throwrx(const char* assertion, const char* file, unsigned line, const char* function) { std::string errText{fmt::format("Assertion failed (handled via exception): {} ({}:{}: {})\n", assertion, file, line, function)}; std::cerr << errText; debug::print_crash_query(std::cerr); throw Error{errAssert, std::move(errText)}; } } // namespace reindexer