Change http logging

Printing method + url again makes it easier to match requests to
responses when scanning logs.

// FREEBIE
pull/749/head
lilia 10 years ago
parent 0f8aff12c5
commit 37ff3cf5a8

@ -38962,15 +38962,15 @@ TextSecureServer = function () {
try { result = JSON.parse(xhr.responseText + ''); } catch(e) {}
}
if ( 0 <= xhr.status && xhr.status < 400) {
console.log('Success', xhr.status, url);
console.log(options.type, url, xhr.status, 'Success');
resolve(result, xhr.status);
} else {
console.log('Error', xhr.status, url);
console.log(options.type, url, xhr.status, 'Error');
reject(HTTPError(xhr.status, result, error.stack));
}
};
xhr.onerror = function() {
console.log('Error', xhr.status, url);
console.log(options.type, url, xhr.status, 'Error');
reject(HTTPError(xhr.status, null, error.stack));
};
xhr.send( options.data || null );

@ -65,15 +65,15 @@ TextSecureServer = function () {
try { result = JSON.parse(xhr.responseText + ''); } catch(e) {}
}
if ( 0 <= xhr.status && xhr.status < 400) {
console.log('Success', xhr.status, url);
console.log(options.type, url, xhr.status, 'Success');
resolve(result, xhr.status);
} else {
console.log('Error', xhr.status, url);
console.log(options.type, url, xhr.status, 'Error');
reject(HTTPError(xhr.status, result, error.stack));
}
};
xhr.onerror = function() {
console.log('Error', xhr.status, url);
console.log(options.type, url, xhr.status, 'Error');
reject(HTTPError(xhr.status, null, error.stack));
};
xhr.send( options.data || null );

Loading…
Cancel
Save