Skip to content

Commit

Permalink
Add symbol ID in the exception message when protobuf fails to resolve…
Browse files Browse the repository at this point in the history
… string references (#1021)

* Add symbol ID in the exception message when protobuf fails to resolve string references

* Bump version to 29.58.9

* Add diff link
  • Loading branch information
idarmans authored Sep 25, 2024
1 parent 4e391df commit 01df2c2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ and what APIs have changed, if applicable.

## [Unreleased]

## [29.58.10] - 2024-09-24
- Add symbol ID in the exception message when protobuf fails to resolve string references.

## [29.58.9] - 2024-09-24
- Fix invalid handling of glob collections for wildcard subscribers

Expand Down Expand Up @@ -5737,7 +5740,8 @@ patch operations can re-use these classes for generating patch messages.

## [0.14.1]

[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.58.9...master
[Unreleased]: https://github.com/linkedin/rest.li/compare/v29.58.10...master
[29.58.10]: https://github.com/linkedin/rest.li/compare/v29.58.9...v29.58.10
[29.58.9]: https://github.com/linkedin/rest.li/compare/v29.58.8...v29.58.9
[29.58.8]: https://github.com/linkedin/rest.li/compare/v29.58.7...v29.58.8
[29.58.7]: https://github.com/linkedin/rest.li/compare/v29.58.6...v29.58.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,10 @@ protected final DataMap readMap(ProtoReader reader) throws IOException
protected final String readStringReference(ProtoReader reader) throws IOException
{
String value;
if ((value = _options.getSymbolTable().getSymbolName(reader.readInt32())) == null)
int symbolId = reader.readInt32();
if ((value = _options.getSymbolTable().getSymbolName(symbolId)) == null)
{
throw new DataDecodingException("Error decoding string reference");
throw new DataDecodingException("Error decoding string reference. Symbol ID: " + symbolId);
}
return value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ private Token readStringReference() throws IOException
}
if ((_stringValue = _symbolTable.getSymbolName(_intValue)) == null)
{
throw new DataDecodingException("Error decoding string reference");
throw new DataDecodingException("Error decoding string reference. Symbol ID: " + _intValue);
}
return STRING;
}
Expand Down

0 comments on commit 01df2c2

Please sign in to comment.