Skip to content

Commit e49baf4

Browse files
committed
update error codes and message
1 parent 985b67c commit e49baf4

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Sources/FaceLiveness/Views/Liveness/FaceLivenessDetectionError.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,16 @@ public struct FaceLivenessDetectionError: Error, Equatable {
126126
recoverySuggestion: "Ensure the device time is correct and try again."
127127
)
128128

129-
public static let invalidCameraPositionSelected = FaceLivenessDetectionError(
130-
code: 18,
131-
message: "The camera position selected is incompatible with the liveness challenge type requested.",
132-
recoverySuggestion: "Please ensure the camera position is supported for the liveness challenge type requested."
133-
)
134-
135129
public static let cameraNotAvailable = FaceLivenessDetectionError(
136130
code: 18,
137131
message: "The camera is not available.",
138-
recoverySuggestion: "There might be a hardware issue."
132+
recoverySuggestion: "There might be a hardware issue or the selected camera is not available."
133+
)
134+
135+
public static let invalidCameraPositionSelected = FaceLivenessDetectionError(
136+
code: 19,
137+
message: "The camera position selected is incompatible with the liveness challenge type requested.",
138+
recoverySuggestion: "Please ensure the camera position is supported for the liveness challenge type requested."
139139
)
140140

141141
public static func == (lhs: FaceLivenessDetectionError, rhs: FaceLivenessDetectionError) -> Bool {

Sources/FaceLiveness/Views/Liveness/LivenessStateMachine.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ struct LivenessStateMachine {
165165
static let couldNotOpenStream = LivenessError(code: 5, webSocketCloseCode: .unexpectedRuntimeError)
166166
static let socketClosed = LivenessError(code: 6, webSocketCloseCode: .normalClosure)
167167
static let viewResignation = LivenessError(code: 8, webSocketCloseCode: .viewClosure)
168-
static let cameraNotAvailable = LivenessError(code: 9, webSocketCloseCode: .missingVideoPermission)
168+
static let cameraNotAvailable = LivenessError(code: 9, webSocketCloseCode: .unexpectedRuntimeError)
169+
static let invalidCameraPositionSelecteed = LivenessError(code: 10, webSocketCloseCode: .unexpectedRuntimeError)
169170

170171
static func == (lhs: LivenessError, rhs: LivenessError) -> Bool {
171172
lhs.code == rhs.code

0 commit comments

Comments
 (0)