Skip to content

Commit

Permalink
exceptions: remove duplicate marshal_exception
Browse files Browse the repository at this point in the history
There are both marshal_exception (defined in types.hh) and
exceptions::marshal_exception (defined ini exceptions/exceptions.hh).
The latter is never thrown by anything but caught in few places which
obviously is incorrect.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
  • Loading branch information
pdziepak committed Jul 6, 2015
1 parent 22568a1 commit 024a706
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
4 changes: 2 additions & 2 deletions cql3/attributes.hh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public:

try {
data_type_for<int64_t>()->validate(*tval);
} catch (exceptions::marshal_exception e) {
} catch (marshal_exception e) {
throw exceptions::invalid_request_exception("Invalid timestamp value");
}
return boost::any_cast<int64_t>(data_type_for<int64_t>()->deserialize(*tval));
Expand All @@ -93,7 +93,7 @@ public:
try {
data_type_for<int32_t>()->validate(*tval);
}
catch (exceptions::marshal_exception e) {
catch (marshal_exception e) {
throw exceptions::invalid_request_exception("Invalid TTL value");
}

Expand Down
2 changes: 1 addition & 1 deletion cql3/constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ constants::literal::parsed_value(data_type validator)
return long_type->from_string(_text);
}
return validator->from_string(_text);
} catch (const exceptions::marshal_exception& e) {
} catch (const marshal_exception& e) {
throw exceptions::invalid_request_exception(e.what());
}
}
Expand Down
2 changes: 1 addition & 1 deletion cql3/constants.hh
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public:
_receiver->type->validate(value.value());
}
return value;
} catch (const exceptions::marshal_exception& e) {
} catch (const marshal_exception& e) {
throw exceptions::invalid_request_exception(e.what());
}
}
Expand Down
7 changes: 0 additions & 7 deletions exceptions/exceptions.hh
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,6 @@ public:
{ }
};

class marshal_exception : public std::logic_error {
public:
marshal_exception(std::string cause)
: logic_error(cause)
{ }
};

enum class exception_code : int32_t {
SERVER_ERROR = 0x0000,
PROTOCOL_ERROR = 0x000A,
Expand Down

0 comments on commit 024a706

Please sign in to comment.