diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-12-01 21:26:58 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-12-01 21:26:58 +0900 |
| commit | f0f4f8f703b8c927fe8008daecb2d0547d486973 (patch) | |
| tree | aa9f93e55f375f342cc72fb62b5d1cca240c07be /src/FtpConnection.cc | |
| parent | 6bc215fcec22d8bdf760c78cc25cb8798266c8a5 (diff) | |
Added more error code values.
I have not set error code for all exception invocation.
In this change, I set error code where error likely occurs.
Diffstat (limited to 'src/FtpConnection.cc')
| -rw-r--r-- | src/FtpConnection.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/FtpConnection.cc b/src/FtpConnection.cc index da01caac..debde951 100644 --- a/src/FtpConnection.cc +++ b/src/FtpConnection.cc @@ -56,6 +56,7 @@ #include "AuthConfig.h" #include "a2functional.h" #include "util.h" +#include "error_code.h" namespace aria2 { @@ -382,7 +383,8 @@ bool FtpConnection::bulkReceiveResponse if(strbuf_.size() >= 4) { status = getStatus(strbuf_); if(status == 0) { - throw DL_ABORT_EX(EX_INVALID_RESPONSE); + throw DL_ABORT_EX2(EX_INVALID_RESPONSE, + error_code::FTP_PROTOCOL_ERROR); } } else { return false; @@ -549,7 +551,8 @@ unsigned int FtpConnection::receivePwdResponse(std::string& pwd) (last = response.second.find("\"", ++first)) != std::string::npos) { pwd = response.second.substr(first, last-first); } else { - throw DL_ABORT_EX(EX_INVALID_RESPONSE); + throw DL_ABORT_EX2(EX_INVALID_RESPONSE, + error_code::FTP_PROTOCOL_ERROR); } } return response.first; |
