summaryrefslogtreecommitdiffstats
path: root/logic
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-11-16 20:36:01 +0100
committerPetr Mrázek <peterix@gmail.com>2013-11-16 20:36:01 +0100
commit2a45302dfc8d63c627fd1164ef84f434f40bd917 (patch)
tree9edcb6ff7b1cb8613624f27d7beeba6aaa0177fa /logic
parent9693a5e6e96e815ad7617c888ef176e5fe97c9e3 (diff)
downloadMultiMC-2a45302dfc8d63c627fd1164ef84f434f40bd917.tar
MultiMC-2a45302dfc8d63c627fd1164ef84f434f40bd917.tar.gz
MultiMC-2a45302dfc8d63c627fd1164ef84f434f40bd917.tar.lz
MultiMC-2a45302dfc8d63c627fd1164ef84f434f40bd917.tar.xz
MultiMC-2a45302dfc8d63c627fd1164ef84f434f40bd917.zip
Mark forge lib downloads as failed when they fail
Diffstat (limited to 'logic')
-rw-r--r--logic/net/ForgeXzDownload.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/logic/net/ForgeXzDownload.cpp b/logic/net/ForgeXzDownload.cpp
index 6c9d7a60..384019d8 100644
--- a/logic/net/ForgeXzDownload.cpp
+++ b/logic/net/ForgeXzDownload.cpp
@@ -91,6 +91,7 @@ void ForgeXzDownload::downloadFinished()
else
{
// something bad happened
+ m_status = Job_Failed;
m_pack200_xz_file.remove();
m_reply.reset();
emit failed(index_within_job);
@@ -155,6 +156,7 @@ void ForgeXzDownload::decompressAndInstall()
if (s == nullptr)
{
xz_dec_end(s);
+ m_status = Job_Failed;
emit failed(index_within_job);
return;
}
@@ -180,6 +182,7 @@ void ForgeXzDownload::decompressAndInstall()
{
// msg = "Write error\n";
xz_dec_end(s);
+ m_status = Job_Failed;
emit failed(index_within_job);
return;
}
@@ -214,24 +217,28 @@ void ForgeXzDownload::decompressAndInstall()
case XZ_MEM_ERROR:
QLOG_ERROR() << "Memory allocation failed\n";
xz_dec_end(s);
+ m_status = Job_Failed;
emit failed(index_within_job);
return;
case XZ_MEMLIMIT_ERROR:
QLOG_ERROR() << "Memory usage limit reached\n";
xz_dec_end(s);
+ m_status = Job_Failed;
emit failed(index_within_job);
return;
case XZ_FORMAT_ERROR:
QLOG_ERROR() << "Not a .xz file\n";
xz_dec_end(s);
+ m_status = Job_Failed;
emit failed(index_within_job);
return;
case XZ_OPTIONS_ERROR:
QLOG_ERROR() << "Unsupported options in the .xz headers\n";
xz_dec_end(s);
+ m_status = Job_Failed;
emit failed(index_within_job);
return;
@@ -239,12 +246,14 @@ void ForgeXzDownload::decompressAndInstall()
case XZ_BUF_ERROR:
QLOG_ERROR() << "File is corrupt\n";
xz_dec_end(s);
+ m_status = Job_Failed;
emit failed(index_within_job);
return;
default:
QLOG_ERROR() << "Bug!\n";
xz_dec_end(s);
+ m_status = Job_Failed;
emit failed(index_within_job);
return;
}
@@ -260,6 +269,7 @@ void ForgeXzDownload::decompressAndInstall()
}
catch (std::runtime_error &err)
{
+ m_status = Job_Failed;
QLOG_ERROR() << "Error unpacking " << pack_name.toUtf8() << " : " << err.what();
QFile f(m_target_path);
if (f.exists())