2
3
4
5
6
7
8
9
10
11
12
14#ifndef BT_EXCEPTIONS_H
15#define BT_EXCEPTIONS_H
21#include "utils/strcat.hpp"
28 BehaviorTreeException(std::string_view message)
29 : message_(
static_cast<std::string>(message))
32 template <
typename... SV>
33 BehaviorTreeException(
const SV&... args) : message_(StrCat(args...))
36 const char* what()
const noexcept
38 return message_.c_str();
50 LogicError(std::string_view message) : BehaviorTreeException(message)
53 template <
typename... SV>
63 RuntimeError(std::string_view message) : BehaviorTreeException(message)
66 template <
typename... SV>
74 std::string node_name;
75 std::string node_path;
76 std::string registration_name;
84 NodeExecutionError(
TickBacktraceEntry failed_node,
const std::string& original_message)
85 : RuntimeError(formatMessage(failed_node, original_message))
86 , failed_node_(std::move(failed_node))
87 , original_message_(original_message)
96 [[
nodiscard]]
const std::string& originalMessage()
const
98 return original_message_;
103 std::string original_message_;
106 const std::string& original_msg)
108 return StrCat(
"Exception in node '", node.node_path,
"' [", node.registration_name,
109 "]: ", original_msg);
Definition: exceptions.h:26
Definition: exceptions.h:48
Definition: exceptions.h:82
const TickBacktraceEntry & failedNode() const
The node that threw the exception.
Definition: exceptions.h:91
Definition: exceptions.h:61
Definition: action_node.h:24
Information about a node in the tick backtrace.
Definition: exceptions.h:73