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 <stdexcept>
3
#ifdef STACKTRACES
4
#include <backward.hpp>
5
#endif
6
7
inline
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
14
extern
"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
26
abort_with_message
(err);
27
#endif
28
}
log.hpp
info
void info(Args... args)
Definition
log.hpp:70
trace
TestTraceContainer trace
Definition
data_copy.test.cpp:59
throw_or_abort_impl
void throw_or_abort_impl(const char *err)
Definition
throw_or_abort_impl.cpp:14
abort_with_message
void abort_with_message(std::string const &err)
Definition
throw_or_abort_impl.cpp:7
src
barretenberg
env
throw_or_abort_impl.cpp
Generated by
1.9.8