diff options
author | spreis <spreis@yandex-team.com> | 2024-01-23 16:13:43 +0300 |
---|---|---|
committer | spreis <spreis@yandex-team.com> | 2024-01-23 16:29:56 +0300 |
commit | 8ebb5e504f638cbfc9bc614113db611c62630bdb (patch) | |
tree | 935cf53f6dff84bc861117df8c210e9ec381b904 | |
parent | 45f8abf493164d68c21dd7764ad270438fb5ab45 (diff) | |
download | ydb-8ebb5e504f638cbfc9bc614113db611c62630bdb.tar.gz |
Add GEN_FBS
-rw-r--r-- | build/conf/fbs.conf | 1 | ||||
-rw-r--r-- | yt/yt/core/http/http.cpp | 4 | ||||
-rw-r--r-- | yt/yt/core/yson/protobuf_interop.cpp | 10 | ||||
-rw-r--r-- | yt/yt/core/yson/unittests/protobuf_yson_ut.cpp | 4 |
4 files changed, 10 insertions, 9 deletions
diff --git a/build/conf/fbs.conf b/build/conf/fbs.conf index 2f6ccb40f8..c535c437b2 100644 --- a/build/conf/fbs.conf +++ b/build/conf/fbs.conf @@ -100,6 +100,7 @@ macro FBS_NAMESPACE(NAMESPACE, PATH...) { multimodule FBS_LIBRARY { module CPP_FBS: LIBRARY { ENABLE(CPP_FBS) + ENABLE(GEN_FBS) SET(PEERDIR_TAGS CPP_FBS) } diff --git a/yt/yt/core/http/http.cpp b/yt/yt/core/http/http.cpp index 666799d830..1bbffcf32e 100644 --- a/yt/yt/core/http/http.cpp +++ b/yt/yt/core/http/http.cpp @@ -11,7 +11,7 @@ using namespace NConcurrency; TStringBuf ToHttpString(EMethod method) { - switch(method) { + switch (method) { #define XX(num, name, string) case EMethod::name: return #string; YT_HTTP_METHOD_MAP(XX) #undef XX @@ -21,7 +21,7 @@ TStringBuf ToHttpString(EMethod method) TStringBuf ToHttpString(EStatusCode code) { - switch(code) { + switch (code) { #define XX(num, name, string) case EStatusCode::name: return #string; YT_HTTP_STATUS_MAP(XX) #undef XX diff --git a/yt/yt/core/yson/protobuf_interop.cpp b/yt/yt/core/yson/protobuf_interop.cpp index ee4493cb98..450ac2bbfc 100644 --- a/yt/yt/core/yson/protobuf_interop.cpp +++ b/yt/yt/core/yson/protobuf_interop.cpp @@ -1026,11 +1026,11 @@ protected: data); return; case EUtf8Check::ThrowOnFail: - THROW_ERROR_EXCEPTION("String field got non UTF-8 value (Path: %v)", + THROW_ERROR_EXCEPTION("Non UTF-8 value in string field %v", YPathStack_.GetHumanReadablePath()) + << TErrorAttribute("non_utf8_string", data) << TErrorAttribute("ypath", YPathStack_.GetPath()) - << TErrorAttribute("proto_field", fieldFullName) - << TErrorAttribute("non_utf8_string", data); + << TErrorAttribute("proto_field", fieldFullName); } } }; @@ -2511,7 +2511,7 @@ private: case FieldDescriptor::TYPE_ENUM: { ParseScalar([&] { - switch(field->GetEnumYsonStorageType()) { + switch (field->GetEnumYsonStorageType()) { case EEnumYsonStorageType::String: storeEnumAsString(unsignedValue); break; @@ -2753,7 +2753,7 @@ private: case FieldDescriptor::TYPE_ENUM: { ParseVarintPacked<ui32>(length, field, [&] (auto value) { - switch(field->GetEnumYsonStorageType()) { + switch (field->GetEnumYsonStorageType()) { case EEnumYsonStorageType::String: storeEnumAsString(value); break; diff --git a/yt/yt/core/yson/unittests/protobuf_yson_ut.cpp b/yt/yt/core/yson/unittests/protobuf_yson_ut.cpp index 35c422a389..e2550ea774 100644 --- a/yt/yt/core/yson/unittests/protobuf_yson_ut.cpp +++ b/yt/yt/core/yson/unittests/protobuf_yson_ut.cpp @@ -1033,7 +1033,7 @@ TEST(TYsonToProtobufTest, ValidUtf8StringCheck) .EndMap(); }; if (option == EUtf8Check::ThrowOnFail) { - EXPECT_THROW_WITH_SUBSTRING(check(), "String field got non UTF-8 value"); + EXPECT_THROW_WITH_SUBSTRING(check(), "Non UTF-8 value in string field"); } else { EXPECT_NO_THROW(check()); } @@ -1045,7 +1045,7 @@ TEST(TYsonToProtobufTest, ValidUtf8StringCheck) TYsonWriter ysonWriter(&newYsonOutputStream, EYsonFormat::Pretty); if (option == EUtf8Check::ThrowOnFail) { EXPECT_THROW_WITH_SUBSTRING( - WriteProtobufMessage(&ysonWriter, message), "String field got non UTF-8 value"); + WriteProtobufMessage(&ysonWriter, message), "Non UTF-8 value in string field"); } else { EXPECT_NO_THROW(WriteProtobufMessage(&ysonWriter, message)); } |