Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
throw_or_abort_impl.cpp
Go to the documentation of this file.
2#include <stdexcept>
3#ifdef STACKTRACES
4#include <backward.hpp>
5#endif
6
7inline void abort_with_message [[noreturn]] (std::string const& err)
8{
9 info("abort: ", err);
10 std::abort();
11}
12
13// Native implementation of throw_or_abort
14extern "C" void throw_or_abort_impl [[noreturn]] (const char* err)
15{
16
17#ifdef STACKTRACES
18 // Use backward library to print stack trace
19 backward::StackTrace trace;
20 trace.load_here(32);
21 backward::Printer{}.print(trace);
22#endif
23#ifndef BB_NO_EXCEPTIONS
24 throw std::runtime_error(err);
25#else
27#endif
28}
void info(Args... args)
Definition log.hpp:70
TestTraceContainer trace
void throw_or_abort_impl(const char *err)
void abort_with_message(std::string const &err)