Permalink
Browse files

server unreachable warning

  • Loading branch information...
Manuel-777 committed Dec 26, 2018
1 parent 968b789 commit 098c373dbbe61fbd7bb1b9b5aa8ed802d5b30076
Showing with 7 additions and 0 deletions.
  1. +7 −0 window_background/http-api.js
@@ -18,6 +18,7 @@ global
*/
const async = require("async");
const qs = require('qs');
let metadataState = false;

var httpAsync = [];
httpBasic();
@@ -118,6 +119,7 @@ function httpBasic() {

if (_headers.method == 'get_database') {
//resetLogLoop(100);
metadataState = true;
delete parsedResult.ok;
setsList = parsedResult.sets;
eventsList = parsedResult.events;
@@ -163,6 +165,11 @@ function httpBasic() {
});
});
req.on('error', function(e) {
console.error(`problem with request: ${e.message}`);
if (!metadataState) {
ipc_send("popup", {"text": "Server unreachable, try offline mode.", "time": 0});
}

callback(e);
removeFromHttp(_headers.reqId);
ipc_send("ipc_log", e.message);

0 comments on commit 098c373

Please sign in to comment.