                 case .success:
                     print("made it")
                 case .failure(let error):
-                    if (error as NSError).wmf_isNetworkConnectionError() {
-                        WMFAlertManager.sharedInstance.showErrorAlertWithMessage(WMFLocalizedString("talk-page-error-unable-to-post-reply", value: "No internet connection. Unable to post reply.", comment: "Error message appearing when user attempts to post a new talk page reply while being offline"), sticky: true, dismissPreviousAlerts: true)
-                    } else if let talkPageError = error as? TalkPageError {
-                        WMFAlertManager.sharedInstance.showWarningAlert(talkPageError.localizedDescription, sticky: true, dismissPreviousAlerts: true)
-                    }
+                    self.showNoInternetConnectionAlertOrOtherWarning(from: error, noInternetConnectionAlertMessage: WMFLocalizedString("talk-page-error-unable-to-post-reply", value: "No internet connection. Unable to post reply.", comment: "Error message appearing when user attempts to post a new talk page reply while being offline"))
                 }
             }
         }

                    self?.navigationController?.popViewController(animated: true)
                    NotificationCenter.default.post(name: Notification.Name(TalkPageContainerViewController.WMFTopicPublishedNotificationName), object: nil)
                case .failure(let error):
                    if (error as NSError).wmf_isNetworkConnectionError() {
                        WMFAlertManager.sharedInstance.showErrorAlertWithMessage(WMFLocalizedString("talk-page-error-unable-to-post-topic", value: "No internet connection. Unable to post topic.", comment: "Error message appearing when user attempts to post a new talk page topic while being offline"), sticky: true, dismissPreviousAlerts: true)
                    } else if let talkPageError = error as? TalkPageError {
                        WMFAlertManager.sharedInstance.showWarningAlert(talkPageError.localizedDescription, sticky: true, dismissPreviousAlerts: true)
                    }
                }
            }
        }

        wmf_showEmptyView(of: .unableToLoadTalkPage, theme: self.theme, frame: self.view.bounds)
    }

    private func showNoInternetConnectionAlertOrOtherWarning(from error: Error, noInternetConnectionAlertMessage: String = CommonStrings.noInternetConnection) {
        if (error as NSError).wmf_isNetworkConnectionError() {
            WMFAlertManager.sharedInstance.showErrorAlertWithMessage(noInternetConnectionAlertMessage, sticky: true, dismissPreviousAlerts: true)
        } else if let talkPageError = error as? TalkPageError {
            WMFAlertManager.sharedInstance.showWarningAlert(talkPageError.localizedDescription, sticky: true, dismissPreviousAlerts: true)
        }  else {
            WMFAlertManager.sharedInstance.showErrorAlertWithMessage(error.localizedDescription, sticky: true, dismissPreviousAlerts: true)
        }
    }
}
