Gracefully handle null data in refresh offer message and log error #5788
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User reported an unhandled exception popup in v1.7.5.
Just before the issue the client did get a disconnect:
b.n.p.n.Connection: proto is null because protoInputStream.read()=-1 (EOF). That is expected if client got stopped without proper shutdown.
A offer refresh TTL message should not contain incomplete data, but is possible if the network connection is interrupted. There are other examples of interrupted network messages already logged.
Fix is to catch and log the exception stack trace. Just adds a try..catch block in
P2PDataStorage.refreshTTL
.Fixes #5786
If there is an alternative way to handle this, let me know. @bisq-network/bisq-devs
Before
After:
[[NO POPUP SHOWN]]
and logfile contains a stack trace of the error: