iceoryx2
C++ Language Bindings
Loading...
Searching...
No Matches
error_handler_interface.hpp
Go to the documentation of this file.
1// Copyright (c) 2023 by Apex.AI Inc. All rights reserved.
2// Copyright (c) 2025 Contributors to the Eclipse Foundation
3//
4// See the NOTICE file(s) distributed with this work for additional
5// information regarding copyright ownership.
6//
7// This program and the accompanying materials are made available under the
8// terms of the Apache Software License 2.0 which is available at
9// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
10// which is available at https://opensource.org/licenses/MIT.
11//
12// SPDX-License-Identifier: Apache-2.0 OR MIT
13
14#ifndef IOX2_BB_REPORTING_ERROR_REPORTING_CUSTOM_ERROR_HANDLER_INTERFACE_HPP
15#define IOX2_BB_REPORTING_ERROR_REPORTING_CUSTOM_ERROR_HANDLER_INTERFACE_HPP
16
20
21namespace iox2 {
22namespace legacy {
23namespace er {
30 const ErrorCode& code,
31 const ModuleId& module = ModuleId())
33 , code(code)
34 , module(module) {
35 }
36
39 ModuleId module;
40};
41
43// NOLINTJUSTIFICATION abstract interface
44// NOLINTNEXTLINE(cppcoreguidelines-special-member-functions, hicpp-special-member-functions)
46 public:
47 virtual ~ErrorHandlerInterface() = default;
48
50 virtual void onPanic() = 0;
51
55
59};
60
61} // namespace er
62} // namespace legacy
63} // namespace iox2
64
65#endif // IOX2_BB_REPORTING_ERROR_REPORTING_CUSTOM_ERROR_HANDLER_INTERFACE_HPP
Defines the dynamic error handling interface (i.e. changeable at runtime).
virtual void onReportError(ErrorDescriptor desc)=0
Defines the reaction on error.
virtual void onPanic()=0
Defines the reaction on panic.
virtual void onReportViolation(ErrorDescriptor desc)=0
Defines the reaction on violation (a bug in the code)
constexpr bool always_false_v
Helper value to bind a static_assert to a type.
Contains all required information about the error. Can be extended as needed without breaking the int...
constexpr ErrorDescriptor(const bb::detail::SourceLocation &location, const ErrorCode &code, const ModuleId &module=ModuleId())