SEcube open-source SDK
L0_error_manager.h
Go to the documentation of this file.
1 
10 #include <iostream>
11 #include <exception>
12 
13 class L0Exception : public std::exception {
14 public:
15  virtual const char* what() const throw() {
16  return "General exception in the L0 API";
17  }
18 };
19 
20 class L0NoDeviceException : public L0Exception {
21 public:
22  virtual const char* what() const throw() {
23  return "No device at the specified pointer!";
24  }
25 };
26 
27 class L0CommunicationErrorException : public L0Exception {
28  virtual const char* what() const throw() {
29  return "Communication error!";
30  }
31 };
32 
33 class L0TXRXException : public L0Exception {
34 public:
35  virtual const char* what() const throw() {
36  return "Error while transmitting data!";
37  }
38 };
39 
40 
41 /*
42 class L0DeviceAlreadyOpenException : public L0Exception {
43  virtual const char* what() const throw() {
44  return "Another device is already opened!";
45  }
46 };*/
47 
48 class L0NoDeviceOpenedException : public L0Exception {
49  virtual const char* what() const throw() {
50  return "No device opened!";
51  }
52 };
53 
54 class L0ParametersErrorException : public L0Exception {
55  virtual const char* what() const throw() {
56  return "Parameter Error!";
57  }
58 };
59 
60 class L0TXException : public L0Exception {
61  virtual const char* what() const throw() {
62  return "TX Error!";
63  }
64 };
65 
66 class L0RXException : public L0Exception {
67  virtual const char* what() const throw() {
68  return "RX Error!";
69  }
70 };
71 
72 class L0FactoryInitException : public L0Exception {
73  virtual const char* what() const throw() {
74  return "Exception while performing the factory initialization!";
75  }
76 };
77 
78 class L0EchoException : public L0Exception {
79  virtual const char* what() const throw() {
80  return "Echo exception!";
81  }
82 };