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
|
@@ -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
|
}
|
package/src/api/utils/errors.ts
CHANGED
|
@@ -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
|
}
|