Face Engine SDK  5.16.0
A face detection, recognition and tracking engine.
FSDKError.h
Go to the documentation of this file.
1 
8 #pragma once
9 
10 #include <fsdk/Types/Result.h>
11 
12 namespace fsdk {
13 
17  enum class FSDKError : uint32_t {
18  Ok,
19  Internal,
20  InvalidInput,
21  InvalidImage,
22 
23  InvalidRect,
24  InvalidImageFormat,
25  InvalidImageSize,
26  InvalidDetection,
27  InvalidLandmarks5,
28  InvalidLandmarks68,
29  InvalidTransformation,
30  InvalidDescriptor,
31  InvalidDescriptorBatch,
32  InvalidSettingsProvider,
33  InvalidDescriptorId,
34  InvalidPath,
35  InvalidSerializedObject,
36 
37  ModuleNotInitialized,
38  ModuleNotReady,
39  LicenseError,
40 
41  BufferIsNull,
42  BufferIsFull,
43  BufferIsEmpty,
44  InvalidBufferSize,
45  InvalidSpanSize,
46  InvalidBatch,
47 
48  IncompatibleDescriptors,
49  EnableJustInBetaMode,
50 
51  FiltredAggregationError,
52 
53  BatchedInternalError,
54  UnsupportedFunctionality, // !< was requested unsupported functionality for this type of descroptor or for
56  // this model version
57 
58  HighMemoryUsage, // !< Operation required a lot of memory. Batch size if too big for example.
59 
60  IncompatibleModelVersions,
61  ModelNotLoaded,
62  InvalidConfig,
63  LicenseIsNotActivated,
64  FeatureNotAvailable,
65  FeatureExpired,
66  FingerprintError,
67  ValidationFailed,
68 
70  };
71 
75  template <>
77 
78  static bool isOk(FSDKError error) noexcept {
79  return error == FSDKError::Ok;
80  }
81 
82  static const char* toString(FSDKError error) noexcept {
83  switch(error) {
84  case FSDKError::Ok:
85  return "Ok";
87  return "Internal error";
89  return "Invalid input";
91  return "Invalid image";
92  case FSDKError::InvalidRect:
93  return "Invalid rectangle";
94  case FSDKError::InvalidImageFormat:
95  return "Invalid image format";
96  case FSDKError::InvalidImageSize:
97  return "Invalid image size";
98  case FSDKError::InvalidDetection:
99  return "Invalid detection";
100  case FSDKError::InvalidLandmarks5:
101  return "Invalid landmarks 5";
102  case FSDKError::InvalidLandmarks68:
103  return "Invalid landmarks 68";
104  case FSDKError::InvalidTransformation:
105  return "Invalid transformation.";
106  case FSDKError::InvalidDescriptor:
107  return "Invalid descriptor";
108  case FSDKError::InvalidDescriptorBatch:
109  return "Invalid descriptor batch.";
110  case FSDKError::InvalidSettingsProvider:
111  return "Invalid settings provider..";
112  case FSDKError::InvalidDescriptorId:
113  return "Invalid descriptor id.";
115  return "Invalid path.";
116  case FSDKError::InvalidSerializedObject:
117  return "Invalid serialized object.";
118  case FSDKError::ModuleNotInitialized:
119  return "Module is not initialized";
120  case FSDKError::ModuleNotReady:
121  return "Module is not ready";
122  case FSDKError::LicenseError:
123  return "Licensing issue";
124  case FSDKError::BufferIsNull:
125  return "Buffer is null";
126  case FSDKError::BufferIsFull:
127  return "Buffer is full";
128  case FSDKError::BufferIsEmpty:
129  return "Buffer is empty";
130  case FSDKError::InvalidBufferSize:
131  return "Invalid buffer size";
132  case FSDKError::InvalidSpanSize:
133  return "Invalid span size";
134  case FSDKError::InvalidBatch:
135  return "Invalid Batch";
136  case FSDKError::IncompatibleDescriptors:
137  return "Descriptors are incompatible";
138  case FSDKError::EnableJustInBetaMode:
139  return "Attempt to create feature while betaMode is turned off";
140  case FSDKError::FiltredAggregationError:
141  return "Cant aggregate descriptors - all images'a GSs are less the threashold";
142  case FSDKError::BatchedInternalError:
143  return "Something gone wrong in batched query";
144  case FSDKError::UnsupportedFunctionality:
145  return "Was requested unsupported functionality";
146  case FSDKError::HighMemoryUsage:
147  return "Operation required a lot of memory";
148  case FSDKError::IncompatibleModelVersions:
149  return "Incompatible model versions";
150  case FSDKError::ModelNotLoaded:
151  return "Model not loaded";
152  case FSDKError::InvalidConfig:
153  return "Invalid config";
154  case FSDKError::LicenseIsNotActivated:
155  return "License is not activated!";
156  case FSDKError::FeatureNotAvailable:
157  return "Requested Feature not available.";
158  case FSDKError::FeatureExpired:
159  return "Feature is expired.";
160  case FSDKError::FingerprintError:
161  return "Failed to get device fingerprint.";
162  case FSDKError::ValidationFailed:
163  return "Failed validation.";
165  return "Not implemented.";
166  default:
167  return "Unknown error";
168  }
169  }
170  };
171 
172 } // namespace fsdk
fsdk::FSDKError::InvalidInput
@ InvalidInput
Invalid input.
fsdk::FSDKError
FSDKError
Common SDK error codes.
Definition: FSDKError.h:17
fsdk::FSDKError::Internal
@ Internal
Internal error.
fsdk::FSDKError::InvalidPath
@ InvalidPath
Invalid path to object.
fsdk
SDK namespace.
Definition: IAGSEstimator.h:8
fsdk::FSDKError::Ok
@ Ok
Ok.
fsdk::ErrorTraits
Definition: Result.h:8
fsdk::FSDKError::InvalidImage
@ InvalidImage
Invalid image.