aws-sdk-ios
aws-sdk-ios copied to clipboard
AWSMobileClientError message accessibility
Which AWS Services is the feature request for?
AWSMobileClient
Is your feature request related to a problem? Please describe.
AWSMobileClientError
supports message
property, but the accessibility is internal
.
Therefore we can't get it from other modules.
Describe the solution you'd like
add public
for this property to expose it:
extension AWSMobileClientError {
/// Underlying error message of `AWSMobileClientError`
public var message: String { ... }
Up for this. I need to access this object. I think this is an intentional mistake? For now I'm going to unlock the pod, and add public
keyword.
EDIT: A much better temporary solution, make an extension of the class, and make your own message object, like so:
//
// AWSMobileClientError+Extension.swift
// Project
//
// Created by Glenn Posadas on 1/10/20.
// Copyright © 2020 Glenn Posadas. All rights reserved.
//
import AWSMobileClient
import Foundation
extension AWSMobileClientError {
/// Underlying error message of `AWSMobileClientError`
var errorMessage: String {
switch self {
case .aliasExists(let message),
.badRequest(let message),
.codeDeliveryFailure(let message),
.codeMismatch(let message),
.cognitoIdentityPoolNotConfigured(let message),
.deviceNotRemembered(let message),
.errorLoadingPage(let message),
.expiredCode(let message),
.expiredRefreshToken(let message),
.federationProviderExists(let message),
.groupExists(let message),
.guestAccessNotAllowed(let message),
.idTokenAndAcceessTokenNotIssued(let message),
.idTokenNotIssued(let message),
.identityIdUnavailable(let message),
.internalError(let message),
.invalidConfiguration(let message),
.invalidLambdaResponse(let message),
.invalidOAuthFlow(let message),
.invalidParameter(let message),
.invalidPassword(let message),
.invalidState(let message),
.invalidUserPoolConfiguration(let message),
.limitExceeded(let message),
.mfaMethodNotFound(let message),
.notAuthorized(let message),
.notSignedIn(let message),
.passwordResetRequired(let message),
.resourceNotFound(let message),
.scopeDoesNotExist(let message),
.securityFailed(let message),
.softwareTokenMFANotFound(let message),
.tooManyFailedAttempts(let message),
.tooManyRequests(let message),
.unableToSignIn(let message),
.unexpectedLambda(let message),
.unknown(let message),
.userCancelledSignIn(let message),
.userLambdaValidation(let message),
.userNotConfirmed(let message),
.userNotFound(let message),
.userPoolNotConfigured(let message),
.usernameExists(let message):
return message
}
}
}
I was going to open exactly the same issue until I realised it was already done. This should be public.
There have been a lot of releases since the issue was opened. Would you be able to test this on the latest release?
Thanks for opening this issue. The message
property has been made public -- this change will be included in the next release.