diff --git a/ChangeLog b/ChangeLog index b47d8428..88487228 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,8 @@ 2007-05-20 Tatsuhiro Tsujikawa * Added the simultaneous download feature. - + * src/main.cc: Print "Exception caught: " when exception is caught. + 2007-04-06 Tatsuhiro Tsujikawa * src/PeerAbstractCommand.cc diff --git a/TODO b/TODO index cc222e7f..bbc22999 100644 --- a/TODO +++ b/TODO @@ -37,3 +37,4 @@ * Do not use ufilename in multi-simultaneous download mode. * Merge umask patch. https://sourceforge.net/tracker/index.php?func=detail&aid=1718641&group_id=159897&atid=813673 +* Use CUIDCounter to generate CUID. \ No newline at end of file diff --git a/src/RequestGroup.cc b/src/RequestGroup.cc index 40f9df80..7ebb011b 100644 --- a/src/RequestGroup.cc +++ b/src/RequestGroup.cc @@ -113,9 +113,7 @@ void RequestGroup::shouldCancelDownloadForSafety() _segmentMan->getFilePath().c_str(), _segmentMan->getSegmentFilePath().c_str()); - throw new FatalException(EX_FILE_ALREADY_EXISTS, - _segmentMan->getFilePath().c_str(), - _segmentMan->getSegmentFilePath().c_str()); + throw new FatalException(EX_DOWNLOAD_ABORTED); } } diff --git a/src/TorrentRequestInfo.cc b/src/TorrentRequestInfo.cc index 84c1ab4c..0068c1ca 100644 --- a/src/TorrentRequestInfo.cc +++ b/src/TorrentRequestInfo.cc @@ -81,9 +81,10 @@ RequestInfos TorrentRequestInfo::execute() { } else { if(PIECE_STORAGE(btContext)->getDiskAdaptor()->fileExists()) { if(op->get(PREF_ALLOW_OVERWRITE) != V_TRUE) { - throw new FatalException(EX_FILE_ALREADY_EXISTS, - PIECE_STORAGE(btContext)->getDiskAdaptor()->getFilePath().c_str(), - BT_PROGRESS_INFO_FILE(btContext)->getFilename().c_str()); + logger->notice(MSG_FILE_ALREADY_EXISTS, + PIECE_STORAGE(btContext)->getDiskAdaptor()->getFilePath().c_str(), + BT_PROGRESS_INFO_FILE(btContext)->getFilename().c_str()); + throw new FatalException(EX_DOWNLOAD_ABORTED); } else { PIECE_STORAGE(btContext)->getDiskAdaptor()->openExistingFile(); #ifdef ENABLE_MESSAGE_DIGEST diff --git a/src/main.cc b/src/main.cc index 3ca62f78..73caa868 100644 --- a/src/main.cc +++ b/src/main.cc @@ -741,7 +741,7 @@ int main(int argc, char* argv[]) { */ } } catch(Exception* ex) { - cerr << ex->getMsg() << endl; + cerr << "Exception caught:\n" << ex->getMsg() << endl; delete ex; exit(EXIT_FAILURE); } diff --git a/src/message.h b/src/message.h index 901118d2..17a3f1ee 100644 --- a/src/message.h +++ b/src/message.h @@ -118,4 +118,5 @@ #define EX_INVALID_PAYLOAD_SIZE _("Invalid payload size for %s, size=%d. It should be %d.") #define EX_INVALID_BT_MESSAGE_ID _("Invalid ID=%d for %s. It should be %d.") #define EX_INVALID_CHUNK_CHECKSUM _("Chunk checksum validation failed. checksumIndex=%d, offset=%lld, expectedHash=%s, actualHash=%s") +#define EX_DOWNLOAD_ABORTED _("Download aborted.") #endif // _D_MESSAGE_H_