From 887c2d96e6c3c7330496e4a0378b95cafc49bf1d Mon Sep 17 00:00:00 2001 From: Tuan Pham <103537251+phantumcode@users.noreply.github.com> Date: Fri, 19 Apr 2024 10:46:50 -0500 Subject: [PATCH] chore(predictions): add support for invalid signature exception (#3625) --- .../AWSPredictionsPlugin/Liveness/Events/LivenessEvent.swift | 1 + .../Liveness/SPI/AWSPredictionsPlugin+Liveness.swift | 3 +++ 2 files changed, 4 insertions(+) diff --git a/AmplifyPlugins/Predictions/AWSPredictionsPlugin/Liveness/Events/LivenessEvent.swift b/AmplifyPlugins/Predictions/AWSPredictionsPlugin/Liveness/Events/LivenessEvent.swift index f8ba73d2b9..822373e296 100644 --- a/AmplifyPlugins/Predictions/AWSPredictionsPlugin/Liveness/Events/LivenessEvent.swift +++ b/AmplifyPlugins/Predictions/AWSPredictionsPlugin/Liveness/Events/LivenessEvent.swift @@ -52,6 +52,7 @@ public enum LivenessEventKind { public static let serviceQuotaExceeded = Self(rawValue: "ServiceQuotaExceededException") public static let serviceUnavailable = Self(rawValue: "ServiceUnavailableException") public static let sessionNotFound = Self(rawValue: "SessionNotFoundException") + public static let invalidSignature = Self(rawValue: "InvalidSignatureException") } } diff --git a/AmplifyPlugins/Predictions/AWSPredictionsPlugin/Liveness/SPI/AWSPredictionsPlugin+Liveness.swift b/AmplifyPlugins/Predictions/AWSPredictionsPlugin/Liveness/SPI/AWSPredictionsPlugin+Liveness.swift index f476122ab0..d2eec8d96e 100644 --- a/AmplifyPlugins/Predictions/AWSPredictionsPlugin/Liveness/SPI/AWSPredictionsPlugin+Liveness.swift +++ b/AmplifyPlugins/Predictions/AWSPredictionsPlugin/Liveness/SPI/AWSPredictionsPlugin+Liveness.swift @@ -66,6 +66,7 @@ public struct FaceLivenessSessionError: Swift.Error, Equatable { public static let accessDenied = Self(code: 7) public static let invalidRegion = Self(code: 8) public static let invalidURL = Self(code: 9) + public static let invalidSignature = Self(code: 10) } extension FaceLivenessSessionError { @@ -85,6 +86,8 @@ extension FaceLivenessSessionError { self = .serviceUnavailable case .sessionNotFound: self = .sessionNotFound + case .invalidSignature: + self = .invalidSignature default: self = .unknown }