types: rename why() to what() in exception classes
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
This commit is contained in:
@@ -152,7 +152,7 @@ maps::value::from_serialized(bytes_view value, map_type type, serialization_form
|
||||
}
|
||||
return { std::move(map) };
|
||||
} catch (marshal_exception& e) {
|
||||
throw exceptions::invalid_request_exception(e.why());
|
||||
throw exceptions::invalid_request_exception(e.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ sets::value::from_serialized(bytes_view v, set_type type, serialization_format s
|
||||
}
|
||||
return value(std::move(elements));
|
||||
} catch (marshal_exception& e) {
|
||||
throw exceptions::invalid_request_exception(e.why());
|
||||
throw exceptions::invalid_request_exception(e.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
4
types.hh
4
types.hh
@@ -152,14 +152,14 @@ class marshal_exception : public std::exception {
|
||||
public:
|
||||
marshal_exception() : _why("marshalling error") {}
|
||||
marshal_exception(sstring why) : _why(sstring("marshaling error: ") + why) {}
|
||||
virtual const char* why() const { return _why.c_str(); }
|
||||
virtual const char* what() const noexcept override { return _why.c_str(); }
|
||||
};
|
||||
|
||||
struct runtime_exception : public std::exception {
|
||||
sstring _why;
|
||||
public:
|
||||
runtime_exception(sstring why) : _why(sstring("runtime error: ") + why) {}
|
||||
virtual const char* why() const { return _why.c_str(); }
|
||||
virtual const char* what() const noexcept override { return _why.c_str(); }
|
||||
};
|
||||
|
||||
inline int32_t compare_unsigned(bytes_view v1, bytes_view v2) {
|
||||
|
||||
@@ -46,7 +46,7 @@ validate_cql_key(schema_ptr schema, const partition_key& key) {
|
||||
try {
|
||||
schema->partition_key_type()->validate(b);
|
||||
} catch (const marshal_exception& e) {
|
||||
throw exceptions::invalid_request_exception(e.why());
|
||||
throw exceptions::invalid_request_exception(e.what());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user