private void ReportException(Exception e) { // If this happens while _wifiSender is null, it can only be because Stop() tried to abort a transfer // and CancelAsync didn't work (as usual). At this point the exception is being reported on an orphan thread // very possibly after Bloom has closed down and the localization manager is disposed. // Certainly the _progress thing is no longer visible. So no point in trying to send something // there, it will just cause exceptions. if (_wifiSender != null) { // This method is called on a background thread in response to receiving a request from Bloom Reader. // Exceptions somehow get discarded, so there is no point in letting them propagate further. _progress.Error(id: "Failed", message: "There was an error while sending the book. Possibly the device was disconnected? If you can't see a " + "reason for this the following may be helpful to report to the developers:"); _progress.Exception(e); } Debug.Fail("got exception " + e.Message + " sending book"); }
private void FailSendBook(Exception e) { if (IsDeviceFullOrHung(e)) { SendOutOfStorageSpaceMessage(e); } else { _progress.Error(idSuffix: "FailureToSend", message: "An error occurred and the book was not sent to your Android device."); if (e != null) { //intentionally not localizable (each of these strings costs effort by each translation team) _progress.ErrorWithoutLocalizing("\tTechnical details to share with the development team: "); _progress.Exception(e); Logger.WriteError(e); } Stopped(); } }