Report error received from zip_close

We may want to hide the error text in a release build and replace it with
something more user friendly but then again, the next time this fails on
us at least our users can report more than "doesn't work"...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2015-10-25 23:39:29 +09:00
parent 3b033a85ac
commit 8c706357f4

View file

@ -253,8 +253,16 @@ bool DivelogsDeWebServices::prepare_dives_for_divelogs(const QString &tempfile,
qDebug() << errPrefix << "failed to include dive:" << i;
}
}
zip_close(zip);
xsltFreeStylesheet(xslt);
if (zip_close(zip)) {
int ze, se;
zip_error_t *error = zip_get_error(zip);
ze = zip_error_code_zip(error);
se = zip_error_code_system(error);
report_error(qPrintable(tr("error writing zip file: %s zip error %d system error %d - %s")),
qPrintable(QDir::toNativeSeparators(tempfile)), ze, se, zip_strerror(zip));
return false;
}
return true;
error_close_zip: