Fix first letter case in error messages.
GitOrigin-RevId: 004d1535d3fb04e51a088ad43f2386dea05b7c9c
This commit is contained in:
parent
3306c42e89
commit
197acde4d4
@ -76,7 +76,7 @@ class RawConnection {
|
|||||||
virtual ~Callback() = default;
|
virtual ~Callback() = default;
|
||||||
virtual Status on_raw_packet(const PacketInfo &info, BufferSlice packet) = 0;
|
virtual Status on_raw_packet(const PacketInfo &info, BufferSlice packet) = 0;
|
||||||
virtual Status on_quick_ack(uint64 quick_ack_token) {
|
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() {
|
virtual Status before_write() {
|
||||||
return Status::OK();
|
return Status::OK();
|
||||||
|
@ -116,7 +116,7 @@ Result<int32> HttpDate::parse_http_date(std::string slice) {
|
|||||||
auto gmt = p.read_word();
|
auto gmt = p.read_word();
|
||||||
TRY_STATUS(std::move(p.status()));
|
TRY_STATUS(std::move(p.status()));
|
||||||
if (gmt != "GMT") {
|
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"};
|
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, ' ');
|
string hash(32, ' ');
|
||||||
sha256(data_cbc.substr(0, 208), MutableSlice(hash));
|
sha256(data_cbc.substr(0, 208), MutableSlice(hash));
|
||||||
if (data_cbc.substr(208) != Slice(hash).substr(0, 16)) {
|
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};
|
TlParser len_parser{data_cbc};
|
||||||
@ -253,7 +253,7 @@ ActorOwn<> get_simple_config_google_dns(Promise<SimpleConfigResult> promise, con
|
|||||||
res.r_config = [&]() -> Result<SimpleConfig> {
|
res.r_config = [&]() -> Result<SimpleConfig> {
|
||||||
TRY_RESULT(json, json_decode(http_query->content_));
|
TRY_RESULT(json, json_decode(http_query->content_));
|
||||||
if (json.type() != JsonValue::Type::Object) {
|
if (json.type() != JsonValue::Type::Object) {
|
||||||
return Status::Error("json error");
|
return Status::Error("JSON error");
|
||||||
}
|
}
|
||||||
auto &answer_object = json.get_object();
|
auto &answer_object = json.get_object();
|
||||||
TRY_RESULT(answer, get_json_object_field(answer_object, "Answer", JsonValue::Type::Array, false));
|
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;
|
vector<string> parts;
|
||||||
for (auto &v : answer_array) {
|
for (auto &v : answer_array) {
|
||||||
if (v.type() != JsonValue::Type::Object) {
|
if (v.type() != JsonValue::Type::Object) {
|
||||||
return Status::Error("json error");
|
return Status::Error("JSON error");
|
||||||
}
|
}
|
||||||
auto &data_object = v.get_object();
|
auto &data_object = v.get_object();
|
||||||
TRY_RESULT(part, get_json_object_string_field(data_object, "data", false));
|
TRY_RESULT(part, get_json_object_string_field(data_object, "data", false));
|
||||||
|
@ -400,7 +400,7 @@ class MessagesDbImpl : public MessagesDbSyncInterface {
|
|||||||
Result<std::pair<DialogId, BufferSlice>> get_message_by_unique_message_id(
|
Result<std::pair<DialogId, BufferSlice>> get_message_by_unique_message_id(
|
||||||
ServerMessageId unique_message_id) override {
|
ServerMessageId unique_message_id) override {
|
||||||
if (!unique_message_id.is_valid()) {
|
if (!unique_message_id.is_valid()) {
|
||||||
return Status::Error("unique_message_id is invalid");
|
return Status::Error("Invalid unique_message_id");
|
||||||
}
|
}
|
||||||
SCOPE_EXIT {
|
SCOPE_EXIT {
|
||||||
get_message_by_unique_message_id_stmt_.reset();
|
get_message_by_unique_message_id_stmt_.reset();
|
||||||
|
@ -174,7 +174,7 @@ static uint8 secret_checksum(Slice secret) {
|
|||||||
|
|
||||||
Result<Secret> Secret::create(Slice secret) {
|
Result<Secret> Secret::create(Slice secret) {
|
||||||
if (secret.size() != 32) {
|
if (secret.size() != 32) {
|
||||||
return Status::Error("wrong secret size");
|
return Status::Error("Wrong secret size");
|
||||||
}
|
}
|
||||||
uint32 checksum = secret_checksum(secret);
|
uint32 checksum = secret_checksum(secret);
|
||||||
if (checksum != 0) {
|
if (checksum != 0) {
|
||||||
|
@ -39,7 +39,7 @@ Status FileHashUploader::init() {
|
|||||||
TRY_RESULT(fd, FileFd::open(local_.path_, FileFd::Read));
|
TRY_RESULT(fd, FileFd::open(local_.path_, FileFd::Read));
|
||||||
TRY_RESULT(file_size, fd.get_size());
|
TRY_RESULT(file_size, fd.get_size());
|
||||||
if (file_size != size_) {
|
if (file_size != size_) {
|
||||||
return Status::Error("size mismatch");
|
return Status::Error("Size mismatch");
|
||||||
}
|
}
|
||||||
fd_ = BufferedFd<FileFd>(std::move(fd));
|
fd_ = BufferedFd<FileFd>(std::move(fd));
|
||||||
sha256_state_.init();
|
sha256_state_.init();
|
||||||
@ -94,7 +94,7 @@ Status FileHashUploader::loop_sha() {
|
|||||||
fd_.get_poll_info().add_flags(PollFlags::Read());
|
fd_.get_poll_info().add_flags(PollFlags::Read());
|
||||||
TRY_RESULT(read_size, fd_.flush_read(static_cast<size_t>(limit)));
|
TRY_RESULT(read_size, fd_.flush_read(static_cast<size_t>(limit)));
|
||||||
if (read_size != 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) {
|
while (true) {
|
||||||
auto ready = fd_.input_buffer().prepare_read();
|
auto ready = fd_.input_buffer().prepare_read();
|
||||||
|
@ -86,14 +86,14 @@ class FileLoader : public FileLoaderActor {
|
|||||||
virtual Callback *get_callback() = 0;
|
virtual Callback *get_callback() = 0;
|
||||||
virtual Result<PrefixInfo> on_update_local_location(const LocalFileLocation &location,
|
virtual Result<PrefixInfo> on_update_local_location(const LocalFileLocation &location,
|
||||||
int64 file_size) TD_WARN_UNUSED_RESULT {
|
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 {
|
virtual Result<bool> should_restart_part(Part part, NetQueryPtr &net_query) TD_WARN_UNUSED_RESULT {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual Status process_check_query(NetQueryPtr net_query) {
|
virtual Status process_check_query(NetQueryPtr net_query) {
|
||||||
return Status::Error("unsupported");
|
return Status::Error("Unsupported");
|
||||||
}
|
}
|
||||||
struct CheckInfo {
|
struct CheckInfo {
|
||||||
bool need_check{false};
|
bool need_check{false};
|
||||||
|
@ -192,7 +192,7 @@ Result<MemStat> mem_stat() {
|
|||||||
|
|
||||||
if (KERN_SUCCESS !=
|
if (KERN_SUCCESS !=
|
||||||
task_info(mach_task_self(), TASK_BASIC_INFO, reinterpret_cast<task_info_t>(&t_info), &t_info_count)) {
|
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;
|
MemStat res;
|
||||||
res.resident_size_ = t_info.resident_size;
|
res.resident_size_ = t_info.resident_size;
|
||||||
@ -296,7 +296,7 @@ Status cpu_stat_self(CpuStat &stat) {
|
|||||||
s++;
|
s++;
|
||||||
pass_cnt++;
|
pass_cnt++;
|
||||||
} else {
|
} else {
|
||||||
return Status::Error("unexpected end of proc file");
|
return Status::Error("Unexpected end of proc file");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Status::OK();
|
return Status::OK();
|
||||||
|
@ -632,7 +632,7 @@ class Master : public Actor {
|
|||||||
int32 binlog_generation_ = 0;
|
int32 binlog_generation_ = 0;
|
||||||
void sync_binlog(int32 binlog_generation, Promise<> promise) {
|
void sync_binlog(int32 binlog_generation, Promise<> promise) {
|
||||||
if (binlog_generation != binlog_generation_) {
|
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));
|
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());
|
promise.set_value(Unit());
|
||||||
}
|
}
|
||||||
void FakeSecretChatContext::on_flush_history(MessageId, Promise<> promise) {
|
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) {
|
void FakeSecretChatContext::on_read_message(int64, Promise<> promise) {
|
||||||
promise.set_error(Status::Error("unsupported"));
|
promise.set_error(Status::Error("Unsupported"));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(Secret, go) {
|
TEST(Secret, go) {
|
||||||
|
Loading…
Reference in New Issue
Block a user