4 #ifndef FACE_SDK_EXCEPTION_H 5 #define FACE_SDK_EXCEPTION_H 12 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) 20 #pragma warning(disable:4275) 21 #pragma warning(disable:4251) 56 class FACE_SDK_EXPORT
exception :
public std::exception
62 exception(
const std::string &message,
int code);
64 std::string type_name()
const;
68 virtual const char* what()
const noexcept
override;
73 std::string _type_name;
77 #define DEFINE_FACE_SDK_EXCEPTION(x, code) \ 79 class FACE_SDK_EXPORT x : public face_sdk::exception \ 83 { _type_name = std::string(#x); _code = (code); } \ 85 explicit x(const std::string &message) \ 86 : exception(message, (code)) \ 87 { _type_name = std::string(#x); _code = (code); } \ 90 DEFINE_FACE_SDK_EXCEPTION(runtime_exception, 1000);
92 DEFINE_FACE_SDK_EXCEPTION(internal_error_exception, 1001);
94 DEFINE_FACE_SDK_EXCEPTION(out_of_range_exception, 1002);
96 DEFINE_FACE_SDK_EXCEPTION(invalid_parameter_exception, 1003);
98 DEFINE_FACE_SDK_EXCEPTION(file_exception, 1004);
100 DEFINE_FACE_SDK_EXCEPTION(file_not_found_exception, 1005);
102 DEFINE_FACE_SDK_EXCEPTION(bad_image_data_exception, 1006);
104 DEFINE_FACE_SDK_EXCEPTION(bad_image_format_exception, 1007);
106 DEFINE_FACE_SDK_EXCEPTION(signature_mismatch_exception, 1008);
108 DEFINE_FACE_SDK_EXCEPTION(incompatible_version_exception, 1009);
110 DEFINE_FACE_SDK_EXCEPTION(version_not_available_exception, 1010);
112 DEFINE_FACE_SDK_EXCEPTION(key_not_found_exception, 1011);
114 DEFINE_FACE_SDK_EXCEPTION(key_exists_exception, 1012);
116 DEFINE_FACE_SDK_EXCEPTION(data_container_corrupted_exception, 1013);
118 DEFINE_FACE_SDK_EXCEPTION(data_container_entries_limit_exceed_exception, 1014);
120 DEFINE_FACE_SDK_EXCEPTION(not_implemented_exception, 1015);
122 DEFINE_FACE_SDK_EXCEPTION(license_exception, 1016);
124 DEFINE_FACE_SDK_EXCEPTION(nvml_exception, 1017);
126 DEFINE_FACE_SDK_EXCEPTION(platofrm_not_supported_exception, 1018);
128 DEFINE_FACE_SDK_EXCEPTION(not_supported_exception, 1019);
130 DEFINE_FACE_SDK_EXCEPTION(make_builder_exception, 1020);
132 DEFINE_FACE_SDK_EXCEPTION(make_image_compressor_exception, 1021);
134 DEFINE_FACE_SDK_EXCEPTION(image_compressor_runtime_exception, 1022);
136 DEFINE_FACE_SDK_EXCEPTION(alignment_info_additional_data_exception, 1023);
138 DEFINE_FACE_SDK_EXCEPTION(face_out_of_bounds_not_set_exception, 1024);
140 DEFINE_FACE_SDK_EXCEPTION(net_runtime_exception, 1025);
142 DEFINE_FACE_SDK_EXCEPTION(make_net_exception, 1026);
144 DEFINE_FACE_SDK_EXCEPTION(make_fir_matcher_exception, 1027);
146 DEFINE_FACE_SDK_EXCEPTION(make_age_gender_exception, 1028);
148 DEFINE_FACE_SDK_EXCEPTION(age_gender_runtime_exception, 1029);
150 DEFINE_FACE_SDK_EXCEPTION(make_alignment_exception, 1030);
152 DEFINE_FACE_SDK_EXCEPTION(make_quality_checker_exception, 1031);
154 DEFINE_FACE_SDK_EXCEPTION(quality_checker_runtime_exception, 1032);
156 DEFINE_FACE_SDK_EXCEPTION(make_detector_exception, 1033);
158 DEFINE_FACE_SDK_EXCEPTION(detect_faces_exception, 1034);
160 DEFINE_FACE_SDK_EXCEPTION(make_face_recognition_exception, 1035);
162 DEFINE_FACE_SDK_EXCEPTION(make_nn_checker_exception, 1036);
164 DEFINE_FACE_SDK_EXCEPTION(nn_checker_runtime_exception, 1037);
166 DEFINE_FACE_SDK_EXCEPTION(frame_process_exception, 1038);
168 DEFINE_FACE_SDK_EXCEPTION(make_red_eyes_checker_exception, 1039);
170 DEFINE_FACE_SDK_EXCEPTION(red_eyes_checker_runtime_exception, 1040);
172 DEFINE_FACE_SDK_EXCEPTION(make_face_color_checker_exception, 1041);
174 DEFINE_FACE_SDK_EXCEPTION(face_color_checker_runtime_exception, 1042);
176 DEFINE_FACE_SDK_EXCEPTION(make_background_checker_exception, 1043);
178 DEFINE_FACE_SDK_EXCEPTION(background_checker_runtime_exception, 1044);
180 DEFINE_FACE_SDK_EXCEPTION(make_mask_checker_exception, 1045);
182 DEFINE_FACE_SDK_EXCEPTION(mask_checker_runtime_exception, 1046);
184 DEFINE_FACE_SDK_EXCEPTION(http_client_exception, 1047);
186 DEFINE_FACE_SDK_EXCEPTION(make_liveness_exception, 1048);
188 DEFINE_FACE_SDK_EXCEPTION(make_pure_fir_extractor_exception, 1049);
190 DEFINE_FACE_SDK_EXCEPTION(make_fir_matching_score_table_exception, 1050);
192 DEFINE_FACE_SDK_EXCEPTION(keychain_exception, 1051);
194 #define UPSCALE_TOO_MUCH_EXCEPTION_CODE 2000 196 class FACE_SDK_EXPORT upscale_too_much_exception :
public exception 201 upscale_too_much_exception(
const std::string &message, uint32_t idx) :
exception(message, UPSCALE_TOO_MUCH_EXCEPTION_CODE)
203 _type_name =
"upscale_too_much_exception";
216 bool FACE_SDK_EXPORT is_root_exception_of_type(
const std::type_info &tp,
const face_sdk::exception &e);
222 #define FACE_SDK_RETHROW_ROOT(x) try{ x; } catch (const face_sdk::exception &exp ) { rethrow_root_exception(exp); } 225 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) 229 #endif //FACE_SDK_EXCEPTION_H
Definition: alignment_info.h:8
Base FaceSDK exception class. Almost all exceptions that FaceSDK throws are inherits this class...
Definition: exception.h:56