Skip to content

Commit

Permalink
Fix compatibility with protobuf v26+: migrate from deprecated `AddErr…
Browse files Browse the repository at this point in the history
…or()` to

`RecordError()` also in text parser’s `ErrorCollector`.

PiperOrigin-RevId: 640152285
  • Loading branch information
QrczakMK committed Jun 4, 2024
1 parent 4072cc5 commit 09b8c79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions riegeli/messages/text_parse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ namespace riegeli {

namespace messages_internal {

void StringErrorCollector::AddError(int line,
google::protobuf::io::ColumnNumber column,
const std::string& message) {
void StringErrorCollector::RecordError(
int line, google::protobuf::io::ColumnNumber column,
absl::string_view message) {
if (line >= 0) {
absl::StrAppend(&errors_, "\nAt ", line + 1, ":", column + 1, ": ",
message);
Expand Down
4 changes: 2 additions & 2 deletions riegeli/messages/text_parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ namespace messages_internal {

class StringErrorCollector : public google::protobuf::io::ErrorCollector {
public:
void AddError(int line, google::protobuf::io::ColumnNumber column,
const std::string& message) override;
void RecordError(int line, google::protobuf::io::ColumnNumber column,
absl::string_view message) override;

absl::string_view errors() const { return errors_; }

Expand Down

0 comments on commit 09b8c79

Please sign in to comment.