exceptions: convert sprint() to format()

sprint() recently became more strict, throwing on sprint("%s", 5). Replace
with the more modern format().

Mechanically converted with https://github.com/avikivity/unsprint.
This commit is contained in:
Avi Kivity
2018-10-29 15:38:39 +02:00
parent 7ae23d8f9b
commit 71fc5fb738
3 changed files with 4 additions and 4 deletions

View File

@@ -45,5 +45,5 @@
#include "log.hh"
exceptions::truncate_exception::truncate_exception(std::exception_ptr ep)
: request_execution_exception(exceptions::exception_code::PROTOCOL_ERROR, sprint("Error during truncate: %s", ep))
: request_execution_exception(exceptions::exception_code::PROTOCOL_ERROR, format("Error during truncate: {}", ep))
{}

View File

@@ -282,11 +282,11 @@ private:
{ }
public:
already_exists_exception(sstring ks_name_, sstring cf_name_)
: already_exists_exception{ks_name_, cf_name_, sprint("Cannot add already existing table \"%s\" to keyspace \"%s\"", cf_name_, ks_name_)}
: already_exists_exception{ks_name_, cf_name_, format("Cannot add already existing table \"{}\" to keyspace \"{}\"", cf_name_, ks_name_)}
{ }
already_exists_exception(sstring ks_name_)
: already_exists_exception{ks_name_, "", sprint("Cannot add existing keyspace \"%s\"", ks_name_)}
: already_exists_exception{ks_name_, "", format("Cannot add existing keyspace \"{}\"", ks_name_)}
{ }
};

View File

@@ -69,7 +69,7 @@ public:
* @param relation the entity relation
*/
unrecognized_entity_exception(::shared_ptr<cql3::column_identifier> entity, cql3::relation_ptr relation)
: invalid_request_exception(sprint("Undefined name %s in where clause ('%s')", *entity, relation->to_string()))
: invalid_request_exception(format("Undefined name {} in where clause ('{}')", *entity, relation->to_string()))
, entity(entity)
, relation(relation)
{ }