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.
3#include <stdexcept>
4#ifdef STACKTRACES
5#include <backward.hpp>
6#endif
7
8inline void abort_with_message [[noreturn]] (std::string const& err)
9{
10 info("abort: ", err);
11 std::abort();
12}
13
14// WASM_EXPORT ensures this symbol stays visible when compiling with -fvisibility=hidden.
15WASM_EXPORT void throw_or_abort_impl [[noreturn]] (const char* err)
16{
17
18#ifdef STACKTRACES
19 // Use backward library to print stack trace
20 backward::StackTrace trace;
21 trace.load_here(32);
22 backward::Printer{}.print(trace);
23#endif
24#ifndef BB_NO_EXCEPTIONS
25 throw std::runtime_error(err);
26#else
28#endif
29}
#define info(...)
Definition log.hpp:93
TestTraceContainer trace
WASM_EXPORT void throw_or_abort_impl(const char *err)
void abort_with_message(std::string const &err)
#define WASM_EXPORT