[polari] app: Don't treat network unavailability as app error



commit a1ea1a9d0b7a66bab38f0a774d584a684654309c
Author: Bastian Ilsø <bastianilso src gnome org>
Date:   Sun Aug 2 17:50:29 2015 +0200

    app: Don't treat network unavailability as app error
    
    If we receive a disconnect error and the network is
    unavailable, then the error is not specific to Polari.

 src/application.js |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index f273278..64ea113 100644
--- a/src/application.js
+++ b/src/application.js
@@ -308,6 +308,11 @@ const Application = new Lang.Class({
             req.ensure_channel_finish(res);
         } catch (e if e.matches(Tp.Error, Tp.Error.DISCONNECTED)) {
             let error = account.connection_error;
+            // If we receive a disconnect error and the network is unavailable,
+            // then the error is not specific to polari and polari will
+            // just be in offline state.
+            if (!this._networkMonitor.network_available)
+                return;
             if (error == ConnectionError.ALREADY_CONNECTED &&
                 requestData.retry++ < MAX_RETRIES) {
                     this._retryRequest(requestData);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]