ifm3d
err.h
1 // -*- c++ -*-
2 /*
3  * Copyright 2018-present ifm electronic, gmbh
4  * Copyright 2017 Love Park Robotics, LLC
5  * SPDX-License-Identifier: Apache-2.0
6  */
7 
8 #ifndef IFM3D_DEVICE_ERR_H
9 #define IFM3D_DEVICE_ERR_H
10 
11 #include <exception>
12 #include <string>
13 #include <ifm3d/device/module_device.h>
14 
21 // library errors
22 extern IFM3D_EXPORT const int IFM3D_NO_ERRORS;
23 extern IFM3D_EXPORT const int IFM3D_XMLRPC_FAILURE;
24 extern IFM3D_EXPORT const int IFM3D_XMLRPC_TIMEOUT;
25 extern IFM3D_EXPORT const int IFM3D_JSON_ERROR;
26 extern IFM3D_EXPORT const int IFM3D_NO_ACTIVE_APPLICATION;
27 extern IFM3D_EXPORT const int IFM3D_SUBCOMMAND_ERROR;
28 extern IFM3D_EXPORT const int IFM3D_IO_ERROR;
29 extern IFM3D_EXPORT const int IFM3D_THREAD_INTERRUPTED;
30 extern IFM3D_EXPORT const int IFM3D_PCIC_BAD_REPLY;
31 extern IFM3D_EXPORT const int IFM3D_UNSUPPORTED_OP;
32 extern IFM3D_EXPORT const int IFM3D_IMG_CHUNK_NOT_FOUND;
33 extern IFM3D_EXPORT const int IFM3D_PIXEL_FORMAT_ERROR;
34 extern IFM3D_EXPORT const int IFM3D_UNSUPPORTED_DEVICE;
35 extern IFM3D_EXPORT const int IFM3D_RECOVERY_CONNECTION_ERROR;
36 extern IFM3D_EXPORT const int IFM3D_UPDATE_ERROR;
37 extern IFM3D_EXPORT const int IFM3D_PCICCLIENT_UNSUPPORTED_DEVICE;
38 extern IFM3D_EXPORT const int IFM3D_HEADER_VERSION_MISMATCH;
39 extern IFM3D_EXPORT const int IFM3D_INTRINSIC_CALIBRATION_UNSUPPORTED_DEVICE;
40 extern IFM3D_EXPORT const int IFM3D_INTRINSIC_CALIBRATION_UNSUPPORTED_FIRMWARE;
41 extern IFM3D_EXPORT const int
42  IFM3D_INVERSE_INTRINSIC_CALIBRATION_UNSUPPORTED_DEVICE;
43 extern IFM3D_EXPORT const int
44  IFM3D_INVERSE_INTRINSIC_CALIBRATION_UNSUPPORTED_FIRMWARE;
45 extern IFM3D_EXPORT const int IFM3D_CURL_ERROR;
46 extern IFM3D_EXPORT const int IFM3D_CURL_TIMEOUT;
47 extern IFM3D_EXPORT const int IFM3D_CURL_ABORTED;
48 extern IFM3D_EXPORT const int IFM3D_SWUPDATE_BAD_STATE;
49 extern IFM3D_EXPORT const int IFM3D_CONFIDENCE_IMAGE_FORMAT_NOT_SUPPORTED;
50 extern IFM3D_EXPORT const int IFM3D_DISTANCE_NOISE_IMAGE_UNSUPPORTED_DEVICE;
51 extern IFM3D_EXPORT const int IFM3D_DISTANCE_NOISE_IMAGE_UNSUPPORTED_FIRMWARE;
52 extern IFM3D_EXPORT const int IFM3D_INVALID_PORT;
53 extern IFM3D_EXPORT const int IFM3D_TOOL_COMMAND_UNSUPPORTED_DEVICE;
54 extern IFM3D_EXPORT const int IFM3D_UNSUPPORTED_SCHEMA_ON_DEVICE;
55 extern IFM3D_EXPORT const int IFM3D_BUFFER_ID_NOT_AVAILABLE;
56 extern IFM3D_EXPORT const int IFM3D_NETWORK_ERROR;
57 extern IFM3D_EXPORT const int IFM3D_SYSTEM_ERROR;
58 extern IFM3D_EXPORT const int IFM3D_CORRUPTED_STRUCT;
59 extern IFM3D_EXPORT const int IFM3D_DEVICE_PORT_INCOMPATIBLE_WITH_ORGANIZER;
60 extern IFM3D_EXPORT const int IFM3D_DEVICE_PORT_NOT_SUPPORTED;
61 extern IFM3D_EXPORT const int IFM3D_INDEX_OUT_OF_RANGE;
62 extern IFM3D_EXPORT const int IFM3D_NO_INPUT_PROVIDED;
63 // sensor errors
64 extern IFM3D_EXPORT const int IFM3D_XMLRPC_OBJ_NOT_FOUND;
65 extern IFM3D_EXPORT const int IFM3D_INVALID_PARAM;
66 extern IFM3D_EXPORT const int IFM3D_INVALID_VALUE_TYPE;
67 extern IFM3D_EXPORT const int IFM3D_VALUE_OUT_OF_RANGE;
68 extern IFM3D_EXPORT const int IFM3D_READONLY_PARAM;
69 extern IFM3D_EXPORT const int IFM3D_SESSION_ALREADY_ACTIVE;
70 extern IFM3D_EXPORT const int IFM3D_INVALID_PASSWORD;
71 extern IFM3D_EXPORT const int IFM3D_INVALID_SESSIONID;
72 extern IFM3D_EXPORT const int IFM3D_COULD_NOT_REBOOT;
73 extern IFM3D_EXPORT const int IFM3D_INVALID_FORMAT;
74 extern IFM3D_EXPORT const int IFM3D_INVALID_DEVICE_TYPE;
75 extern IFM3D_EXPORT const int IFM3D_INVALID_IMPORT_FLAGS;
76 extern IFM3D_EXPORT const int IFM3D_INVALID_APP_INDEX;
77 extern IFM3D_EXPORT const int IFM3D_APP_IN_EDIT_MODE;
78 extern IFM3D_EXPORT const int IFM3D_MAX_APP_LIMIT;
79 extern IFM3D_EXPORT const int IFM3D_NO_APP_IN_EDIT_MODE;
80 extern IFM3D_EXPORT const int IFM3D_CANNOT_SW_TRIGGER;
81 extern IFM3D_EXPORT const int IFM3D_INVALID_IMAGER_TYPE;
82 extern IFM3D_EXPORT const int IFM3D_UNSUPPORTED_APP_TYPE;
83 extern IFM3D_EXPORT const int IFM3D_PIN_ALREADY_IN_USE;
84 extern IFM3D_EXPORT const int IFM3D_NO_SUCH_MODEL_OR_ROI;
85 extern IFM3D_EXPORT const int IFM3D_TEMPORAL_FILTER_TRIGGER_CONFLICT;
86 extern IFM3D_EXPORT const int IFM3D_EEPROM_FAIL;
87 extern IFM3D_EXPORT const int IFM3D_IMPORT_EXPORT_IN_PROGRESS;
88 extern IFM3D_EXPORT const int IFM3D_INVALID_NET_CONFIG;
89 extern IFM3D_EXPORT const int IFM3D_LED_DUTY_CYCLE_VIOLATION;
90 extern IFM3D_EXPORT const int IFM3D_AUTO_EXPOSURE_NOT_SUPPORTED;
91 extern IFM3D_EXPORT const int IFM3D_INVALID_FIRMWARE_VERSION;
92 extern IFM3D_EXPORT const int IFM3D_PROXY_AUTH_REQUIRED;
93 extern IFM3D_EXPORT const int IFM3D_PIXEL_FORMAT_NOT_SUPPORTED;
97 namespace ifm3d
98 {
105  IFM3D_EXPORT const char* strerror(int errnum);
106 
112  class IFM3D_EXPORT Error : public std::exception
113  {
114  public:
120  Error(int errnum, const std::string& msg = "");
121 
125  const char* what() const noexcept override;
126 
130  int code() const noexcept;
131 
135  const char* message() const noexcept;
136 
137  private:
142  int errnum_;
143 
147  std::string errmsg_;
148 
153  std::string what_;
154 
155  }; // end: class Error
156 
157 } // end: namespace ifm3d
158 
159 #endif // IFM3D_DEVICE_ERR_H
ifm3d::Error
Definition: err.h:112