mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 07:13:34 +08:00
Centralized fatal error handling via handleFatalError(msg)
This commit is contained in:
@@ -4,10 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
#include <stdexcept>
|
||||
#include <typeinfo>
|
||||
#include <uavcan/internal/fatal_error.hpp>
|
||||
#include <uavcan/internal/impl_constants.hpp>
|
||||
#include <uavcan/internal/util.hpp>
|
||||
|
||||
@@ -23,14 +20,7 @@ class MethodBinder
|
||||
void validateBeforeCall() const
|
||||
{
|
||||
if (!operator bool())
|
||||
{
|
||||
#if UAVCAN_EXCEPTIONS
|
||||
throw std::runtime_error(typeid(*this).name());
|
||||
#else
|
||||
assert(0);
|
||||
std::abort();
|
||||
#endif
|
||||
}
|
||||
handleFatalError("Null method binder");
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user