summaryrefslogtreecommitdiff
path: root/src/PeerAbstractCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-06-16 15:11:41 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2008-06-16 15:11:41 +0000
commit1c2dd30bf74200e1033fcb09ceec22a4e1f34e05 (patch)
treea21fa68650587760b4934ed7219bc7328fa464a6 /src/PeerAbstractCommand.cc
parent953d1683a34541e6c58fa4b99ffdbe06376666fc (diff)
2008-06-16 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
When there is not enough space in disk when writing a chunk of data, aria2 now prints the message to the console to warn user and aborts its download. Not all downloads are canceled because some downloads may use another disk or partition. BUG#1640332 * src/AbstractDiskWriter.cc * src/PeerAbstractCommand.cc * src/PeerAbstractCommand.h: Added onFailure() function for override. * src/PeerInteractionCommand.cc: In onFailure(), call RequestGroup:: setHaltRequested(true) to cancel download. * src/PeerInteractionCommand.h
Diffstat (limited to 'src/PeerAbstractCommand.cc')
-rw-r--r--src/PeerAbstractCommand.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/PeerAbstractCommand.cc b/src/PeerAbstractCommand.cc
index 83118fa3..1cf11a03 100644
--- a/src/PeerAbstractCommand.cc
+++ b/src/PeerAbstractCommand.cc
@@ -41,6 +41,7 @@
#include "Logger.h"
#include "message.h"
#include "prefs.h"
+#include "DownloadFailureException.h"
namespace aria2 {
@@ -83,6 +84,11 @@ bool PeerAbstractCommand::execute() {
throw DlAbortEx(EX_TIME_OUT);
}
return executeInternal();
+ } catch(DownloadFailureException& err) {
+ logger->error(EX_DOWNLOAD_ABORTED, err);
+ onAbort();
+ onFailure();
+ return true;
} catch(RecoverableException& err) {
logger->debug(MSG_TORRENT_DOWNLOAD_ABORTED, err, cuid);
logger->debug(MSG_PEER_BANNED,