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.
1
#include "
barretenberg/common/log.hpp
"
2
#include "
barretenberg/common/wasm_export.hpp
"
3
#include <stdexcept>
4
#ifdef STACKTRACES
5
#include <backward.hpp>
6
#endif
7
8
inline
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.
15
WASM_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
27
abort_with_message
(err);
28
#endif
29
}
log.hpp
info
#define info(...)
Definition
log.hpp:93
trace
TestTraceContainer trace
Definition
data_copy.test.cpp:63
throw_or_abort_impl
WASM_EXPORT void throw_or_abort_impl(const char *err)
Definition
throw_or_abort_impl.cpp:15
abort_with_message
void abort_with_message(std::string const &err)
Definition
throw_or_abort_impl.cpp:8
wasm_export.hpp
WASM_EXPORT
#define WASM_EXPORT
Definition
wasm_export.hpp:8
src
barretenberg
env
throw_or_abort_impl.cpp
Generated by
1.9.8