libs
libuavcan
libuavcan
src
uc_error.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
3
*/
4
5
#include <
uavcan/error.hpp
>
6
#include <cassert>
7
#include <cstdlib>
8
9
#ifndef UAVCAN_EXCEPTIONS
10
# error UAVCAN_EXCEPTIONS
11
#endif
12
13
#if UAVCAN_EXCEPTIONS
14
# include <stdexcept>
15
#endif
16
17
namespace
uavcan
18
{
19
20
void
handleFatalError
(
const
char
* msg)
21
{
22
#if UAVCAN_EXCEPTIONS
23
throw
std::runtime_error(msg);
24
#else
25
(void)msg;
26
UAVCAN_ASSERT
(0);
27
std::abort();
28
#endif
29
}
30
31
}
uavcan::handleFatalError
UAVCAN_EXPORT void handleFatalError(const char *msg)
Definition:
uc_error.cpp:20
uavcan
Definition:
libuavcan/libuavcan/include/uavcan/build_config.hpp:204
UAVCAN_ASSERT
#define UAVCAN_ASSERT(x)
Definition:
libuavcan/libuavcan/include/uavcan/build_config.hpp:184
error.hpp
uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:03