Astarte device API for C++ 0.6.2
Astarte device SDK for C++
Loading...
Searching...
No Matches
exceptions.hpp
Go to the documentation of this file.
1// (C) Copyright 2025, SECO Mind Srl
2//
3// SPDX-License-Identifier: Apache-2.0
4
5#ifndef ASTARTE_DEVICE_SDK_EXCEPTIONS_H
6#define ASTARTE_DEVICE_SDK_EXCEPTIONS_H
7
12
13#include <exception>
14#include <string>
15
16namespace AstarteDeviceSdk {
17
21class AstarteException : public std::exception {
22 public:
27 explicit AstarteException(std::string message);
32 [[nodiscard]] auto what() const noexcept -> const char* override;
33
34 private:
35 std::string message_;
36};
37
42 public:
47 explicit AstarteFileOpenException(const std::string& filename);
52 [[nodiscard]] auto get_filename() const -> const std::string&;
53
54 private:
55 std::string filename_;
56};
57
62 public:
67 explicit AstarteInvalidInputException(const std::string& err_message);
68};
69
74 public:
79 explicit AstarteInternalException(const std::string& err_message);
80};
81
82} // namespace AstarteDeviceSdk
83
84#endif // ASTARTE_DEVICE_SDK_EXCEPTIONS_H
AstarteException(std::string message)
Constructor for the Astarte exception.
auto what() const noexcept -> const char *override
Implementation of the virtual method what from the partent std::exception class.
auto get_filename() const -> const std::string &
Get the file name for the file which could not be opened.
AstarteFileOpenException(const std::string &filename)
Constructor for the Astarte file open exception.
AstarteInternalException(const std::string &err_message)
Constructor for the Astarte internal exception.
AstarteInvalidInputException(const std::string &err_message)
Constructor for the Astarte incompatible input exception.
Umbrella namespace for the Astarte device SDK.
Definition data.hpp:25