diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-10-25 23:39:29 +0900 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-10-25 23:39:29 +0900 |
commit | 8c706357f477917959fe2d1912909db6675d3e49 (patch) | |
tree | c31f404be70348908f8de3984952169ef4ac3887 /qt-ui/subsurfacewebservices.cpp | |
parent | 3b033a85acced1da17e8dde46bfaae3c8bfdf9d0 (diff) | |
download | subsurface-8c706357f477917959fe2d1912909db6675d3e49.tar.gz |
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>
Diffstat (limited to 'qt-ui/subsurfacewebservices.cpp')
-rw-r--r-- | qt-ui/subsurfacewebservices.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp index 5e2316d30..7c67ecc67 100644 --- a/qt-ui/subsurfacewebservices.cpp +++ b/qt-ui/subsurfacewebservices.cpp @@ -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: |