summaryrefslogtreecommitdiff
path: root/src/CheckIntegrityCommand.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/CheckIntegrityCommand.cc')
-rw-r--r--src/CheckIntegrityCommand.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/CheckIntegrityCommand.cc b/src/CheckIntegrityCommand.cc
index 29fc8b75..dc9d155f 100644
--- a/src/CheckIntegrityCommand.cc
+++ b/src/CheckIntegrityCommand.cc
@@ -40,6 +40,8 @@
#include "message.h"
#include "prefs.h"
#include "DownloadContext.h"
+#include "a2functional.h"
+#include "RecoverableException.h"
namespace aria2 {
@@ -68,13 +70,23 @@ bool CheckIntegrityCommand::executeInternal()
logger->notice(MSG_VERIFICATION_SUCCESSFUL,
_requestGroup->getDownloadContext()->getBasePath().c_str());
std::deque<Command*> commands;
- _entry->onDownloadFinished(commands, _e);
+ try {
+ _entry->onDownloadFinished(commands, _e);
+ } catch(RecoverableException& e) {
+ std::for_each(commands.begin(), commands.end(), Deleter());
+ throw;
+ }
_e->addCommand(commands);
} else {
logger->error(MSG_VERIFICATION_FAILED,
_requestGroup->getDownloadContext()->getBasePath().c_str());
std::deque<Command*> commands;
- _entry->onDownloadIncomplete(commands,_e);
+ try {
+ _entry->onDownloadIncomplete(commands,_e);
+ } catch(RecoverableException& e) {
+ std::for_each(commands.begin(), commands.end(), Deleter());
+ throw;
+ }
_e->addCommand(commands);
}
_e->setNoWait(true);