Skip to content

Commit

Permalink
chore: Fix error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
harsh62 committed Aug 28, 2023
1 parent 03b72e9 commit 447f529
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,19 @@ class VerifyTOTPSetupTask: AuthVerifyTOTPSetupTask, DefaultLogger {
let result = try await userPoolService.verifySoftwareToken(input: input)

guard let output = result.status else {
throw AuthError.service("Result cannot be retrieved", "")
throw AuthError.service("Verify TOTP Result cannot be retrieved", AmplifyErrorMessages.shouldNotHappenReportBugToAWS())
}

switch output {
case .error:
throw AuthError.service("Unknown error", "")
throw AuthError.service("Unknown service error occurred",
AmplifyErrorMessages.reportBugToAWS())
case .success:
return
case .sdkUnknown(let error):
throw AuthError.service("Unknown error", error)
throw AuthError.service(
error,
AmplifyErrorMessages.reportBugToAWS())
}

}
Expand Down

0 comments on commit 447f529

Please sign in to comment.