Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading