libcpp4ec
C++ for EtherCat Library
 All Classes Functions Variables Typedefs Enumerations Enumerator
EcError.h
1 #ifndef ECERROR_H
2 #define ECERROR_H
3 
4 #include <exception>
5 #include <iostream>
6 #include <string>
7 #include <sstream>
13 class EcError/*: public exception*/
14 {
15 public:
16 
17  enum
18  {
19  ECAT_ERROR,
20  FAIL_EC_INIT,
21  FAIL_EC_CONFIG_INIT,
22  FAIL_SWITCHING_STATE_INIT,
23  FAIL_SWITCHING_STATE_PRE_OP,
24  FAIL_SWITCHING_STATE_SAFE_OP,
25  FAIL_SWITCHING_STATE_OPERATIONAL,
26  FAIL_CREATING_DRIVER,
27  FAIL_OUTPUT_LABEL,
28  FAIL_OPENING_OUTPUT,
29  FAIL_WRITING,
30  FAIL_INPUT_LABEL,
31  FAIL_OPENING_INPUT,
32  FAIL_READING,
33  };
34 
39  EcError(int errorcode) throw();
40 
45  virtual const char* what() const throw();
46 
51  virtual int getErrorCode() const throw ();
52 
53 private:
54  int m_errorcode;
55 
56 };
57 
58 #endif
Class EcError.
Definition: EcError.h:13
virtual const char * what() const
Get string identifying exception.
Definition: EcError.cpp:28
EcError(int errorcode)
Constructor.
Definition: EcError.cpp:18
virtual int getErrorCode() const
Get the code of the error.
Definition: EcError.cpp:22