cpp: Eliminate circular dependency between thrift libraries
Previously, Thrift.cpp contained TApplicationException, which was using
TProtocol methods, defined in TProtocol.h. This caused a circular
dependency since libprotocol depends on Thrift.h. This change moves
TApplicationException into its own file.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@920682 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/protocol/TDenseProtocol.cpp b/lib/cpp/src/protocol/TDenseProtocol.cpp
index 8e76dc4..b9a3d1f 100644
--- a/lib/cpp/src/protocol/TDenseProtocol.cpp
+++ b/lib/cpp/src/protocol/TDenseProtocol.cpp
@@ -266,7 +266,7 @@
uint32_t TDenseProtocol::writeMessageBegin(const std::string& name,
const TMessageType messageType,
const int32_t seqid) {
- throw TApplicationException("TDenseProtocol doesn't work with messages (yet).");
+ throw TException("TDenseProtocol doesn't work with messages (yet).");
int32_t version = (VERSION_2) | ((int32_t)messageType);
uint32_t wsize = 0;
@@ -290,7 +290,7 @@
if (type_spec_ == NULL) {
resetState();
- throw TApplicationException("TDenseProtocol: No type specified.");
+ throw TException("TDenseProtocol: No type specified.");
} else {
assert(type_spec_->ttype == T_STRUCT);
ts_stack_.push_back(type_spec_);
@@ -481,7 +481,7 @@
uint32_t TDenseProtocol::readMessageBegin(std::string& name,
TMessageType& messageType,
int32_t& seqid) {
- throw TApplicationException("TDenseProtocol doesn't work with messages (yet).");
+ throw TException("TDenseProtocol doesn't work with messages (yet).");
uint32_t xfer = 0;
int32_t sz;
@@ -514,7 +514,7 @@
if (type_spec_ == NULL) {
resetState();
- throw TApplicationException("TDenseProtocol: No type specified.");
+ throw TException("TDenseProtocol: No type specified.");
} else {
assert(type_spec_->ttype == T_STRUCT);
ts_stack_.push_back(type_spec_);