Fix first letter case in error messages.

GitOrigin-RevId: 004d1535d3fb04e51a088ad43f2386dea05b7c9c
This commit is contained in:
levlam 2019-08-26 04:53:22 +03:00
parent 3306c42e89
commit 197acde4d4
8 changed files with 16 additions and 16 deletions

View File

@ -76,7 +76,7 @@ class RawConnection {
virtual ~Callback() = default;
virtual Status on_raw_packet(const PacketInfo &info, BufferSlice packet) = 0;
virtual Status on_quick_ack(uint64 quick_ack_token) {
return Status::Error("quick acks unsupported fully, but still used");
return Status::Error("Quick acks unsupported fully, but still used");
}
virtual Status before_write() {
return Status::OK();

View File

@ -116,7 +116,7 @@ Result<int32> HttpDate::parse_http_date(std::string slice) {
auto gmt = p.read_word();
TRY_STATUS(std::move(p.status()));
if (gmt != "GMT") {
return Status::Error("timezone must be GMT");
return Status::Error("Timezone must be GMT");
}
static Slice month_names[12] = {"jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec"};
@ -177,7 +177,7 @@ Result<SimpleConfig> decode_config(Slice input) {
string hash(32, ' ');
sha256(data_cbc.substr(0, 208), MutableSlice(hash));
if (data_cbc.substr(208) != Slice(hash).substr(0, 16)) {
return Status::Error("sha256 mismatch");
return Status::Error("SHA256 mismatch");
}
TlParser len_parser{data_cbc};
@ -253,7 +253,7 @@ ActorOwn<> get_simple_config_google_dns(Promise<SimpleConfigResult> promise, con
res.r_config = [&]() -> Result<SimpleConfig> {
TRY_RESULT(json, json_decode(http_query->content_));
if (json.type() != JsonValue::Type::Object) {
return Status::Error("json error");
return Status::Error("JSON error");
}
auto &answer_object = json.get_object();
TRY_RESULT(answer, get_json_object_field(answer_object, "Answer", JsonValue::Type::Array, false));
@ -261,7 +261,7 @@ ActorOwn<> get_simple_config_google_dns(Promise<SimpleConfigResult> promise, con
vector<string> parts;
for (auto &v : answer_array) {
if (v.type() != JsonValue::Type::Object) {
return Status::Error("json error");
return Status::Error("JSON error");
}
auto &data_object = v.get_object();
TRY_RESULT(part, get_json_object_string_field(data_object, "data", false));

View File

@ -400,7 +400,7 @@ class MessagesDbImpl : public MessagesDbSyncInterface {
Result<std::pair<DialogId, BufferSlice>> get_message_by_unique_message_id(
ServerMessageId unique_message_id) override {
if (!unique_message_id.is_valid()) {
return Status::Error("unique_message_id is invalid");
return Status::Error("Invalid unique_message_id");
}
SCOPE_EXIT {
get_message_by_unique_message_id_stmt_.reset();

View File

@ -174,7 +174,7 @@ static uint8 secret_checksum(Slice secret) {
Result<Secret> Secret::create(Slice secret) {
if (secret.size() != 32) {
return Status::Error("wrong secret size");
return Status::Error("Wrong secret size");
}
uint32 checksum = secret_checksum(secret);
if (checksum != 0) {

View File

@ -39,7 +39,7 @@ Status FileHashUploader::init() {
TRY_RESULT(fd, FileFd::open(local_.path_, FileFd::Read));
TRY_RESULT(file_size, fd.get_size());
if (file_size != size_) {
return Status::Error("size mismatch");
return Status::Error("Size mismatch");
}
fd_ = BufferedFd<FileFd>(std::move(fd));
sha256_state_.init();
@ -94,7 +94,7 @@ Status FileHashUploader::loop_sha() {
fd_.get_poll_info().add_flags(PollFlags::Read());
TRY_RESULT(read_size, fd_.flush_read(static_cast<size_t>(limit)));
if (read_size != static_cast<size_t>(limit)) {
return Status::Error("unexpected end of file");
return Status::Error("Unexpected end of file");
}
while (true) {
auto ready = fd_.input_buffer().prepare_read();

View File

@ -86,14 +86,14 @@ class FileLoader : public FileLoaderActor {
virtual Callback *get_callback() = 0;
virtual Result<PrefixInfo> on_update_local_location(const LocalFileLocation &location,
int64 file_size) TD_WARN_UNUSED_RESULT {
return Status::Error("unsupported");
return Status::Error("Unsupported");
}
virtual Result<bool> should_restart_part(Part part, NetQueryPtr &net_query) TD_WARN_UNUSED_RESULT {
return false;
}
virtual Status process_check_query(NetQueryPtr net_query) {
return Status::Error("unsupported");
return Status::Error("Unsupported");
}
struct CheckInfo {
bool need_check{false};

View File

@ -192,7 +192,7 @@ Result<MemStat> mem_stat() {
if (KERN_SUCCESS !=
task_info(mach_task_self(), TASK_BASIC_INFO, reinterpret_cast<task_info_t>(&t_info), &t_info_count)) {
return Status::Error("task_info failed");
return Status::Error("Call to task_info failed");
}
MemStat res;
res.resident_size_ = t_info.resident_size;
@ -296,7 +296,7 @@ Status cpu_stat_self(CpuStat &stat) {
s++;
pass_cnt++;
} else {
return Status::Error("unexpected end of proc file");
return Status::Error("Unexpected end of proc file");
}
}
return Status::OK();

View File

@ -632,7 +632,7 @@ class Master : public Actor {
int32 binlog_generation_ = 0;
void sync_binlog(int32 binlog_generation, Promise<> promise) {
if (binlog_generation != binlog_generation_) {
return promise.set_error(Status::Error("binlog generation mismatch"));
return promise.set_error(Status::Error("Binlog generation mismatch"));
}
binlog_->force_sync(std::move(promise));
}
@ -991,10 +991,10 @@ void FakeSecretChatContext::on_delete_messages(std::vector<int64> random_id, Pro
promise.set_value(Unit());
}
void FakeSecretChatContext::on_flush_history(MessageId, Promise<> promise) {
promise.set_error(Status::Error("unsupported"));
promise.set_error(Status::Error("Unsupported"));
}
void FakeSecretChatContext::on_read_message(int64, Promise<> promise) {
promise.set_error(Status::Error("unsupported"));
promise.set_error(Status::Error("Unsupported"));
}
TEST(Secret, go) {