AIRO-1464 Add a try catch so that bad logic from one received message doesn't c… #227
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.
So in an ideal scenario,
topicInfo.OnMessageReceived(contents);always works fine, but malformed messages or bad code means that sometimes that's not always the case. The idea behind this change is that even iftopicInfo.OnMessageReceived(contents);does throw an exception, it will just move on to the next received message in the queue. Without this the Update method of the ROSConnection will exit this frame and any other waiting messages will be forced to wait for the next frame. If you have some bad actor that throws an exception every frame, you could have an unbounded queue size and messages will never get received.Provide any relevant links here.
Types of change(s)
fix/workaroundTesting and Verification
Please describe the tests that you ran to verify your changes. Please also provide instructions, ROS packages, and Unity project files as appropriate so we can reproduce the test environment.
Test Configuration:
Checklist
devbranchdevbranchOther comments