HaikuDepot/RatePackageWindow: Output in error code paths

This commit is contained in:
Stephan Aßmus
2014-10-04 12:32:59 +02:00
parent c6e3208e3e
commit fa09af9a8f
+14 -2
View File
@@ -387,8 +387,10 @@ RatePackageWindow::_QueryRatingThreadEntry(void* data)
void void
RatePackageWindow::_QueryRatingThread() RatePackageWindow::_QueryRatingThread()
{ {
if (!Lock()) if (!Lock()) {
fprintf(stderr, "rating query: Failed to lock window\n");
return; return;
}
PackageInfoRef package(fPackage); PackageInfoRef package(fPackage);
@@ -399,6 +401,7 @@ RatePackageWindow::_QueryRatingThread()
locker.Unlock(); locker.Unlock();
if (package.Get() == NULL) { if (package.Get() == NULL) {
fprintf(stderr, "rating query: No package\n");
_SetWorkerThread(-1); _SetWorkerThread(-1);
return; return;
} }
@@ -458,6 +461,11 @@ RatePackageWindow::_QueryRatingThread()
fSendButton->SetLabel(B_TRANSLATE("Update")); fSendButton->SetLabel(B_TRANSLATE("Update"));
Unlock(); Unlock();
} else {
fprintf(stderr, "rating query: Failed response: %s\n",
strerror(status));
if (!info.IsEmpty())
info.PrintToStream();
} }
_SetWorkerThread(-1); _SetWorkerThread(-1);
@@ -476,8 +484,10 @@ RatePackageWindow::_SendRatingThreadEntry(void* data)
void void
RatePackageWindow::_SendRatingThread() RatePackageWindow::_SendRatingThread()
{ {
if (!Lock()) if (!Lock()) {
fprintf(stderr, "upload rating: Failed to lock window\n");
return; return;
}
BString package = fPackage->Title(); BString package = fPackage->Title();
BString architecture = fPackage->Architecture(); BString architecture = fPackage->Architecture();
@@ -551,6 +561,8 @@ RatePackageWindow::_SendRatingThread()
fprintf(stderr, fprintf(stderr,
B_TRANSLATE("Failed to create or update rating: %s\n"), B_TRANSLATE("Failed to create or update rating: %s\n"),
error.String()); error.String());
if (!info.IsEmpty())
info.PrintToStream();
_SetWorkerThread(-1); _SetWorkerThread(-1);
} else { } else {