@@ -20,6 +20,10 @@ | |||
xhr.addEventListener("error", function(err) { | |||
cb(err); | |||
}); | |||
xhr.addEventListener("abort", function(err) { | |||
console.log("Aborted."); | |||
cb(err); | |||
}); | |||
xhr.open("POST", url); | |||
xhr.send(); | |||
@@ -59,9 +63,10 @@ | |||
} | |||
function await() { | |||
console.log("await..."); | |||
post("/webevents/await/"+key, function(err, res) { | |||
console.log("Await done,", err ? "with errors" : "no errors"); | |||
if (err) { | |||
console.log("Await done, with errors"); | |||
} | |||
// Retry on error | |||
if (err === "ENOTREGISTERED") { |
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "webevents", | |||
"version": "1.1.1", | |||
"version": "1.1.2", | |||
"description": "A simple library for sending events from the server to the client.", | |||
"main": "index.js", | |||
"scripts": { |