13#ifndef RTCTK_COMPONENTFRAMEWORK_EXCEPTIONS_HPP
14#define RTCTK_COMPONENTFRAMEWORK_EXCEPTIONS_HPP
20#include <ciiBasicDataType.hpp>
21#include <ciiException.hpp>
28#ifdef CII_MAKE_EXCEPTION
29#undef CII_MAKE_EXCEPTION
31#define CII_MAKE_EXCEPTION(exceptionType_t, ...) \
32 ::error::elt::details::CreateExceptionObject<exceptionType_t>( \
33 0, __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
37#ifdef CII_MAKE_EXCEPTION_WITH_NESTED
38#undef CII_MAKE_EXCEPTION_WITH_NESTED
40#define CII_MAKE_EXCEPTION_WITH_NESTED(exceptionType_t, nested_exception, ...) \
41 ::error::elt::details::CreateExceptionObject<exceptionType_t>( \
42 nested_exception, __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
70 std::string_view
lines,
96 std::is_nothrow_constructible_v<detail::UnspecifiedNested<typename std::decay_t<E>>,
E&&>) {
97 using Type =
typename std::decay_t<E>;
98 static_assert(std::is_class_v<Type>,
"exception must be a non-union class-type");
165 : m_ptr(), m_exception(&exception) {};
170 : m_ptr(std::move(
ptr)), m_exception(
nullptr) {};
178 std::stringstream
ss;
193 }
else if (
printer.m_exception) {
202 std::exception_ptr m_ptr;
203 const std::exception* m_exception;
271 explicit BufferTooSmall(
const std::size_t actual,
const std::size_t expected);
280 const std::size_t expected,
281 const std::string& reason);
Thrown from service factory methods to indicate the adapter construction failed.
Definition exceptions.hpp:395
AdapterCreationException(const std::string &interface_name)
Definition exceptions.cpp:192
The BufferTooSmall is thrown when an API call fails because the provided buffer is not big enough to ...
Definition exceptions.hpp:264
std::size_t m_actual
Definition exceptions.hpp:291
std::size_t GetActualBufferSize() const
Definition exceptions.hpp:283
std::size_t m_expected
Definition exceptions.hpp:292
std::size_t GetExpectedBufferSize() const
Definition exceptions.hpp:286
This Exception is raised when the DDT Publisher returns an error that cannot be handled by the DDT Si...
Definition exceptions.hpp:367
DdtError(const std::string &message)
Definition exceptions.hpp:370
This Exception is raised when an invalid ddt sink is requested.
Definition exceptions.hpp:352
DdtSinkNotFound(const std::string &message)
Definition exceptions.hpp:355
Thrown in cases where an initialisation routine has failed.
Definition exceptions.hpp:313
InitialisationException(const std::string &message)
Definition exceptions.cpp:186
Thrown if an argument passed to a method was invalid.
Definition exceptions.hpp:300
InvalidArgumentException(const std::string &message)
Definition exceptions.cpp:180
This Exception is raised when a invalid setting was used in the runtime repo.
Definition exceptions.hpp:338
InvalidSetting(const std::string &message)
Definition exceptions.hpp:341
This Exception is raised when the state change requested is invalid.
Definition exceptions.hpp:324
InvalidStateChange(const std::string &message)
Definition exceptions.hpp:327
This Exception is raised when the ipc queue returns an error that cannot be handled by the Telemetry ...
Definition exceptions.hpp:382
IpcqError(const std::string &message)
Definition exceptions.hpp:385
Adapter object intended to be used in contexts without direct access to the output-stream object.
Definition exceptions.hpp:159
std::string Str() const
Convenience function for constructing a std::string from the exception.
Definition exceptions.hpp:177
NestedExceptionPrinter(const std::exception &exception) noexcept
Construct from exception derived from std::exception.
Definition exceptions.hpp:164
NestedExceptionPrinter(std::exception_ptr ptr) noexcept
Construct from exception_ptr.
Definition exceptions.hpp:169
friend std::ostream & operator<<(std::ostream &os, const NestedExceptionPrinter &printer)
Formats exception from printer using PrintNestedExceptions.
Definition exceptions.hpp:190
The NotImplementedException is thrown whenever an attempt is made to use a feature or function that h...
Definition exceptions.hpp:228
NotImplementedException(const std::string &feature)
Definition exceptions.cpp:125
The RtctkException class is the base class for all Rtctk exceptions.
Definition exceptions.hpp:211
RtctkException() noexcept
Definition exceptions.cpp:113
~RtctkException() override=default
The UnsupportedTypeException is thrown whenever an attempt is made to use an unsupported type in the ...
Definition exceptions.hpp:239
UnsupportedTypeException(const std::string &type)
Definition exceptions.cpp:132
The UnsupportedUriException is thrown whenever an attempt is made to use an unsupported URI in the RT...
Definition exceptions.hpp:252
UnsupportedUriException(const elt::mal::Uri &uri)
Definition exceptions.cpp:148
Project-wide configuration header.
#define RTCTK_API
Helper to indicate that a class or function must be exported in the public symbol table.
Definition config.hpp:33
std::ostream & JoinLines(std::ostream &os, std::string_view lines, std::string_view initial_indent, std::string_view subsequent_indent)
Join each line in lines with.
Definition exceptions.cpp:26
Definition commandReplier.cpp:22
void PrintNestedExceptions(std::ostream &os, const std::exception &exception)
Print nested exception(s) in exception messages to os.
Definition exceptions.cpp:213
void PrintComposedExceptions(std::ostream &os, const std::vector< std::exception_ptr > &exceptions)
Print composed exception(s) in exception messages to os.
Definition exceptions.cpp:198
auto WrapWithNested(E &&exception) noexcept(std::is_nothrow_constructible_v< detail::UnspecifiedNested< typename std::decay_t< E > >, E && >)
Constructs an unspecified exception that derives from both the provided object and std::nested_except...
Definition exceptions.hpp:95
elt::mal::future< std::string > InjectReqRepEvent(StateMachineEngine &engine)
Definition malEventInjector.hpp:23
Unspecified exception used by WrapWithNested.
Definition exceptions.hpp:57
UnspecifiedNested(E &&e) noexcept(std::is_nothrow_constructible_v< T, E && >)
Definition exceptions.hpp:59