FRC2832 / Robot_2018

FRC Team 2832's code for 2018 - FIRST PowerUp. Java for Robot control, C++ for Arduino additional functionality
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Arduino readBuffer() throwing exception(Java side) #3

Open TheLogicMaster opened 6 years ago

TheLogicMaster commented 6 years ago

If I had written the code, I would have just returned null instead of throwing an exception if it couldn't connect over CAN, but maybe a null byte[] would be a possible value returned with communication. Just a thought, as this way you wouldn't need to add a try and catch statement when you read it. I do realize that this is a common practice with networking methods, though, so maybe it would in fact be best. I just feel that the readBuffer() method should handle the exception itself instead of throwing it.