diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-05-18 15:07:15 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-05-18 15:07:15 +0000 |
| commit | 20e215047c24ac5a63ff10d204003760811f2e2e (patch) | |
| tree | 872156b0b66279fae1977f0d66e14bc2824281d8 /src/DHTMessageFactoryImpl.cc | |
| parent | ff83fc65df3e4ec128c8a8855829cec7cfb6c692 (diff) | |
2009-05-18 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added source filename(__FILE__) and line number(__LINE__) to
exception message.
* src/AbstractCommand.cc
* src/AbstractDiskWriter.cc
* src/AbstractProxyResponseCommand.cc
* src/BDE.h
* src/BtAllowedFastMessage.cc
* src/BtHandshakeMessageValidator.h
* src/BtHaveAllMessage.cc
* src/BtHaveNoneMessage.cc
* src/BtPieceMessage.cc
* src/BtRejectMessage.cc
* src/ChunkedDecoder.cc
* src/CookieStorage.cc
* src/DHTAnnouncePeerMessage.cc
* src/DHTEntryPointNameResolveCommand.cc
* src/DHTMessageFactoryImpl.cc
* src/DHTMessageTracker.cc
* src/DHTRoutingTableDeserializer.cc
* src/DHTRoutingTableSerializer.cc
* src/DHTSetup.cc
* src/DHTTokenTracker.cc
* src/DefaultBtAnnounce.cc
* src/DefaultBtContext.cc
* src/DefaultBtInteractive.cc
* src/DefaultBtMessageFactory.cc
* src/DefaultBtProgressInfoFile.cc
* src/DefaultExtensionMessageFactory.cc
* src/DlAbortEx.h
* src/DlRetryEx.h
* src/DownloadCommand.cc
* src/DownloadEngineFactory.cc
* src/DownloadFailureException.h
* src/Exception.cc
* src/Exception.h
* src/ExpatMetalinkProcessor.cc
* src/ExpatXmlRpcRequestProcessor.cc
* src/FallocFileAllocationIterator.cc
* src/FatalException.h
* src/FtpConnection.cc
* src/FtpFinishDownloadCommand.cc
* src/FtpInitiateConnectionCommand.cc
* src/FtpNegotiationCommand.cc
* src/GZipDecoder.cc
* src/HandshakeExtensionMessage.cc
* src/HttpConnection.cc
* src/HttpHeaderProcessor.cc
* src/HttpInitiateConnectionCommand.cc
* src/HttpResponse.cc
* src/HttpResponseCommand.cc
* src/HttpServer.cc
* src/HttpSkipResponseCommand.cc
* src/InitiateConnectionCommandFactory.cc
* src/IteratableChunkChecksumValidator.cc
* src/LibgcryptARC4Context.h
* src/LibgcryptARC4Decryptor.h
* src/LibgcryptARC4Encryptor.h
* src/LibgcryptDHKeyExchange.h
* src/LibgnutlsTLSContext.cc
* src/LibsslARC4Context.h
* src/LibsslARC4Decryptor.h
* src/LibsslARC4Encryptor.h
* src/LibsslDHKeyExchange.h
* src/LibsslTLSContext.cc
* src/MSEHandshake.cc
* src/MessageDigestHelper.cc
* src/MetalinkHelper.cc
* src/MultiDiskAdaptor.cc
* src/NameMatchOptionHandler.h
* src/NameResolver.cc
* src/Netrc.cc
* src/NsCookieParser.cc
* src/OptionHandlerException.cc
* src/OptionHandlerException.h
* src/OptionHandlerImpl.h
* src/OptionParser.cc
* src/ParameterizedStringParser.cc
* src/PeerAbstractCommand.cc
* src/PeerConnection.cc
* src/PeerMessageUtil.cc
* src/PeerReceiveHandshakeCommand.cc
* src/Platform.cc
* src/ReceiverMSEHandshakeCommand.cc
* src/RecoverableException.h
* src/RequestGroup.cc
* src/SimpleLogger.cc
* src/SocketCore.cc
* src/Sqlite3MozCookieParser.cc
* src/UTPexExtensionMessage.cc
* src/Util.cc
* src/XML2SAXMetalinkProcessor.cc
* src/Xml2XmlRpcRequestProcessor.cc
* src/XmlRpcMethodImpl.cc
* src/bencode.cc
* src/download_helper.cc
* src/messageDigest.h
* test/ExceptionTest.cc
* test/TestUtil.cc
Diffstat (limited to 'src/DHTMessageFactoryImpl.cc')
| -rw-r--r-- | src/DHTMessageFactoryImpl.cc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/DHTMessageFactoryImpl.cc b/src/DHTMessageFactoryImpl.cc index b9fc5eb6..9c4f836d 100644 --- a/src/DHTMessageFactoryImpl.cc +++ b/src/DHTMessageFactoryImpl.cc @@ -89,7 +89,7 @@ static const BDE& getDictionary(const BDE& dict, if(d.isDict()) { return d; } else { - throw DlAbortEx + throw DL_ABORT_EX (StringFormat("Malformed DHT message. Missing %s", key.c_str()).str()); } } @@ -101,7 +101,7 @@ static const BDE& getString(const BDE& dict, if(c.isString()) { return c; } else { - throw DlAbortEx + throw DL_ABORT_EX (StringFormat("Malformed DHT message. Missing %s", key.c_str()).str()); } } @@ -113,7 +113,7 @@ static const BDE& getInteger(const BDE& dict, if(c.isInteger()) { return c; } else { - throw DlAbortEx + throw DL_ABORT_EX (StringFormat("Malformed DHT message. Missing %s", key.c_str()).str()); } } @@ -124,7 +124,7 @@ static const BDE& getString(const BDE& list, size_t index) if(c.isString()) { return c; } else { - throw DlAbortEx + throw DL_ABORT_EX (StringFormat("Malformed DHT message. element[%u] is not String.", index).str()); } @@ -136,7 +136,7 @@ static const BDE& getInteger(const BDE& list, size_t index) if(c.isInteger()) { return c; } else { - throw DlAbortEx + throw DL_ABORT_EX (StringFormat("Malformed DHT message. element[%u] is not Integer.", index).str()); } @@ -149,7 +149,7 @@ static const BDE& getList(const BDE& dict, if(l.isList()) { return l; } else { - throw DlAbortEx + throw DL_ABORT_EX (StringFormat("Malformed DHT message. Missing %s", key.c_str()).str()); } } @@ -157,7 +157,7 @@ static const BDE& getList(const BDE& dict, void DHTMessageFactoryImpl::validateID(const BDE& id) const { if(id.s().size() != DHT_ID_LENGTH) { - throw DlAbortEx + throw DL_ABORT_EX (StringFormat("Malformed DHT message. Invalid ID length." " Expected:%d, Actual:%d", DHT_ID_LENGTH, id.s().size()).str()); @@ -168,7 +168,7 @@ void DHTMessageFactoryImpl::validatePort(const BDE& i) const { BDE::Integer port = i.i(); if(!(0 < port && port < UINT16_MAX)) { - throw DlAbortEx + throw DL_ABORT_EX (StringFormat("Malformed DHT message. Invalid port=%s", Util::itos(port).c_str()).str()); } @@ -184,7 +184,7 @@ SharedHandle<DHTMessage> DHTMessageFactoryImpl::createQueryMessage const BDE& y = getString(dict, DHTMessage::Y); const BDE& aDict = getDictionary(dict, DHTQueryMessage::A); if(y.s() != DHTQueryMessage::Q) { - throw DlAbortEx("Malformed DHT message. y != q"); + throw DL_ABORT_EX("Malformed DHT message. y != q"); } const BDE& id = getString(aDict, DHTMessage::ID); validateID(id); @@ -214,7 +214,7 @@ SharedHandle<DHTMessage> DHTMessageFactoryImpl::createQueryMessage static_cast<uint16_t>(port.i()), token.s(), transactionID.s()); } else { - throw DlAbortEx + throw DL_ABORT_EX (StringFormat("Unsupported message type: %s", messageType.s().c_str()).str()); } @@ -238,9 +238,9 @@ DHTMessageFactoryImpl::createResponseMessage(const std::string& messageType, } else { _logger->debug("e doesn't have 2 elements."); } - throw DlAbortEx("Received Error DHT message."); + throw DL_ABORT_EX("Received Error DHT message."); } else if(y.s() != DHTResponseMessage::R) { - throw DlAbortEx + throw DL_ABORT_EX (StringFormat("Malformed DHT message. y != r: y=%s", Util::urlencode(y.s()).c_str()).str()); } @@ -264,13 +264,13 @@ DHTMessageFactoryImpl::createResponseMessage(const std::string& messageType, return createGetPeersReplyMessageWithNodes(remoteNode, dict, transactionID.s()); } else { - throw DlAbortEx("Malformed DHT message: missing nodes/values"); + throw DL_ABORT_EX("Malformed DHT message: missing nodes/values"); } } } else if(messageType == DHTAnnouncePeerReplyMessage::ANNOUNCE_PEER) { return createAnnouncePeerReplyMessage(remoteNode, transactionID.s()); } else { - throw DlAbortEx + throw DL_ABORT_EX (StringFormat("Unsupported message type: %s", messageType.c_str()).str()); } } @@ -326,7 +326,7 @@ std::deque<SharedHandle<DHTNode> > DHTMessageFactoryImpl::extractNodes(const unsigned char* src, size_t length) { if(length%26 != 0) { - throw DlAbortEx("Nodes length is not multiple of 26"); + throw DL_ABORT_EX("Nodes length is not multiple of 26"); } std::deque<SharedHandle<DHTNode> > nodes; for(size_t offset = 0; offset < length; offset += 26) { |
