IOLink  IOL_v1.2.0_release
Error.h
1 #pragma once
2 
3 #include <iolink/IOLinkAPI.h>
4 #include <exception>
5 #include <string>
6 
7 namespace iolink
8 {
12 class IOLINK_API Error : public std::exception
13 {
14 public:
15  explicit Error(const std::string& msg);
16 
17  const char* what() const noexcept override;
18 
19  ~Error() = default;
20 
21 private:
22  std::string m_msg;
23 };
24 
29 class IOLINK_API InvalidArgument final : public Error
30 {
31 public:
32  explicit InvalidArgument(const std::string& msg);
33 };
34 
40 class IOLINK_API NotImplemented final : public Error
41 {
42 public:
43  explicit NotImplemented(const std::string& function);
44 };
45 
46 } // end namespace iolink