Skip to content

Commit

Permalink
fix(PushNotifications): Fixing .network error not being correctly rep…
Browse files Browse the repository at this point in the history
…orted (#3314)
  • Loading branch information
ruisebas authored Oct 23, 2023
1 parent 8e987b1 commit 07724ea
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ import AwsCommonRuntimeKit

extension CommonRunTimeError: PushNotificationsErrorConvertible {
var pushNotificationsError: PushNotificationsError {
if isConnectivityError {
return .network(
PushNotificationsPluginErrorConstants.deviceOffline.errorDescription,
PushNotificationsPluginErrorConstants.deviceOffline.recoverySuggestion,
self
)
}

switch self {
case .crtError(let crtError):
let errorDescription = isConnectivityError
? AWSPinpointErrorConstants.deviceOffline.errorDescription
: crtError.message
return .unknown(errorDescription, self)
return .unknown(crtError.message, self)
}
}
}

0 comments on commit 07724ea

Please sign in to comment.