nervoscan-js-sdk 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nervoscan-js-sdk",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "main": "dist/nervoscan-js-sdk.umd.js",
5
5
  "module": "dist/nervoscan-js-sdk.mjs",
6
6
  "types": "dist/types/index.d.ts",
@@ -50,6 +50,8 @@ class ErrorHandler {
50
50
  return errorRegistry.FaceLookingLeftError;
51
51
  } else if (error.code === 'FACE_LOOKING_RIGHT_ERROR') {
52
52
  return errorRegistry.FaceLookingRightError;
53
+ } else if (error.code === 'SKIN_EXTRACTION_ERROR') {
54
+ return errorRegistry.SkinExtractionError;
53
55
  } else {
54
56
  return new UnhandledScanError(error);
55
57
  }
@@ -19,4 +19,5 @@ export const errorRegistry = {
19
19
  FaceLookingLeftError: new Errors.FaceLookingLeftError('Face looking left!'),
20
20
  FaceLookingRightError: new Errors.FaceLookingRightError('Face looking right!'),
21
21
  ErrorCallbackNotSetError: new Errors.ErrorCallbackNotSetError('Error callback not set!'),
22
+ SkinExtractionError: new Errors.SkinExtractionError('Skin extraction error! Please use a better lighting!'),
22
23
  }
@@ -202,6 +202,16 @@ export class UnhandledScanError extends NervoscanError {
202
202
  }
203
203
  }
204
204
 
205
+ /**
206
+ * Error thrown when the skin extraction fails.
207
+ * @extends NervoscanError
208
+ */
209
+ export class SkinExtractionError extends NervoscanError {
210
+ constructor(message: string) {
211
+ super(message);
212
+ }
213
+ }
214
+
205
215
  /**
206
216
  * Collection of all Nervoscan error classes.
207
217
  */
@@ -224,5 +234,6 @@ export const Errors = {
224
234
  FaceLookingLeftError,
225
235
  FaceLookingRightError,
226
236
  ErrorCallbackNotSetError,
227
- UnhandledScanError
237
+ UnhandledScanError,
238
+ SkinExtractionError
228
239
  }