aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/protobuf/util/pb_io.cpp
diff options
context:
space:
mode:
authorulanovgeorgiy <ulanovgeorgiy@yandex-team.com>2023-02-02 15:45:06 +0300
committerulanovgeorgiy <ulanovgeorgiy@yandex-team.com>2023-02-02 15:45:06 +0300
commit4676a64273b09b50f84bd7bc93a1ce598512f136 (patch)
treee61825a8073060303ddcba6658d6a13b90f85055 /library/cpp/protobuf/util/pb_io.cpp
parentd356fcb037bfbba8740bde2db0f51a8b4aaa9128 (diff)
downloadydb-4676a64273b09b50f84bd7bc93a1ce598512f136.tar.gz
enabling writing error message to exception in the default
Diffstat (limited to 'library/cpp/protobuf/util/pb_io.cpp')
-rw-r--r--library/cpp/protobuf/util/pb_io.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/cpp/protobuf/util/pb_io.cpp b/library/cpp/protobuf/util/pb_io.cpp
index 3ec95f0a9b..92f3675b53 100644
--- a/library/cpp/protobuf/util/pb_io.cpp
+++ b/library/cpp/protobuf/util/pb_io.cpp
@@ -180,7 +180,7 @@ void ParseFromTextFormat(IInputStream& in, NProtoBuf::Message& m,
NProtoBuf::TextFormat::Parser p;
ConfigureParser(options, p);
- bool writeErrorToException = options & EParseFromTextFormatOption::WriteErrorMessageToException;
+ bool writeErrorToException = !(options & EParseFromTextFormatOption::ForceWriteParsingErrorsToCerr);
TStringStream errorLog;
THolder<TErrorCollector> errorCollector;
@@ -195,7 +195,7 @@ void ParseFromTextFormat(IInputStream& in, NProtoBuf::Message& m,
if (!p.Parse(&adaptor, &m)) {
// remove everything that may have been read
m.Clear();
- if (Y_UNLIKELY(writeErrorToException)) {
+ if (Y_LIKELY(writeErrorToException)) {
ythrow yexception() << errorLog.Str();
} else {
ythrow yexception() << "ParseFromTextFormat failed on Parse for " << m.GetTypeName();