More error reporting from TerraSync/HTTP

- raise more errors when requests fail, and report/catch these.
This commit is contained in:
James Turner
2016-02-25 21:20:33 +02:00
parent 6cef1f9091
commit 0b4f416ddc
2 changed files with 73 additions and 20 deletions
+16 -2
View File
@@ -664,7 +664,16 @@ void SGTerraSync::SvnThread::updateSyncSlot(SyncSlot &slot)
}
slot.repository->setBaseUrl(serverUrl + "/" + slot.currentItem._dir);
slot.repository->update();
try {
slot.repository->update();
} catch (sg_exception& e) {
SG_LOG(SG_TERRASYNC, SG_INFO, "sync of " << slot.repository->baseUrl() << " failed to start with error:"
<< e.getFormattedMessage());
fail(slot.currentItem);
slot.busy = false;
slot.repository.reset();
return;
}
slot.nextWarnTimeout = 20000;
slot.stamp.stamp();
@@ -676,7 +685,12 @@ void SGTerraSync::SvnThread::updateSyncSlot(SyncSlot &slot)
void SGTerraSync::SvnThread::runInternal()
{
while (!_stop) {
_http.update(100);
try {
_http.update(100);
} catch (sg_exception& e) {
SG_LOG(SG_TERRASYNC, SG_WARN, "failure doing HTTP update" << e.getFormattedMessage());
}
_transfer_rate = _http.transferRateBytesPerSec();
// convert from bytes to kbytes
_total_kb_downloaded = static_cast<int>(_http.totalBytesDownloaded() / 1024);