mirror of https://github.com/aria2/aria2
Call RequestGroup::setLastError in
PeerInteractionCommand::onFailure(). Added const Exception& argument to virtual AbstractCommand::onFailure().pull/1/head
parent
d5b6ec8621
commit
a0139e3e08
|
@ -106,7 +106,7 @@ bool PeerAbstractCommand::execute()
|
||||||
} catch(DownloadFailureException& err) {
|
} catch(DownloadFailureException& err) {
|
||||||
A2_LOG_ERROR_EX(EX_DOWNLOAD_ABORTED, err);
|
A2_LOG_ERROR_EX(EX_DOWNLOAD_ABORTED, err);
|
||||||
onAbort();
|
onAbort();
|
||||||
onFailure();
|
onFailure(err);
|
||||||
return true;
|
return true;
|
||||||
} catch(RecoverableException& err) {
|
} catch(RecoverableException& err) {
|
||||||
A2_LOG_DEBUG_EX(fmt(MSG_TORRENT_DOWNLOAD_ABORTED,
|
A2_LOG_DEBUG_EX(fmt(MSG_TORRENT_DOWNLOAD_ABORTED,
|
||||||
|
|
|
@ -82,7 +82,7 @@ protected:
|
||||||
virtual void onAbort() {};
|
virtual void onAbort() {};
|
||||||
// This function is called when DownloadFailureException is caught right after
|
// This function is called when DownloadFailureException is caught right after
|
||||||
// the invocation of onAbort().
|
// the invocation of onAbort().
|
||||||
virtual void onFailure() {};
|
virtual void onFailure(const Exception& err) {};
|
||||||
virtual bool exitBeforeExecute() = 0;
|
virtual bool exitBeforeExecute() = 0;
|
||||||
virtual bool executeInternal() = 0;
|
virtual bool executeInternal() = 0;
|
||||||
void setReadCheckSocket(const SharedHandle<SocketCore>& socket);
|
void setReadCheckSocket(const SharedHandle<SocketCore>& socket);
|
||||||
|
|
|
@ -367,8 +367,9 @@ void PeerInteractionCommand::onAbort() {
|
||||||
peerStorage_->returnPeer(getPeer());
|
peerStorage_->returnPeer(getPeer());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PeerInteractionCommand::onFailure()
|
void PeerInteractionCommand::onFailure(const Exception& err)
|
||||||
{
|
{
|
||||||
|
requestGroup_->setLastErrorCode(err.getErrorCode());
|
||||||
requestGroup_->setHaltRequested(true);
|
requestGroup_->setHaltRequested(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ protected:
|
||||||
virtual bool executeInternal();
|
virtual bool executeInternal();
|
||||||
virtual bool prepareForNextPeer(time_t wait);
|
virtual bool prepareForNextPeer(time_t wait);
|
||||||
virtual void onAbort();
|
virtual void onAbort();
|
||||||
virtual void onFailure();
|
virtual void onFailure(const Exception& err);
|
||||||
virtual bool exitBeforeExecute();
|
virtual bool exitBeforeExecute();
|
||||||
public:
|
public:
|
||||||
PeerInteractionCommand(cuid_t cuid,
|
PeerInteractionCommand(cuid_t cuid,
|
||||||
|
|
Loading…
Reference in New Issue