Closed Vrumfondel closed 5 years ago
Yessss ..... like in some other places aswell. What about adding an crash-handler like CrashReporter.NET?
The most try-catch currently in the solution is about when doing someing over the serial com port since it has a tendency to be unstable.
This try catch is to catch unknown faults when messing with the gui, hence the code smell. I belive the cause of the troubles is since we use "dont read response" when sending commands when we send a faulty command the next read response command gets the fault error from previous command sent. This leads to errors, like the active slot where it expects a slot answer but gets 200 response.
I would think exactely this should be prevented by _comport.DiscardInBuffer(); at the beginning of all commands expecting an response ...
For sure issues within the gui should be handled nicely - but ever now and then there might be something overlooked. That's why I proposed to add an Crashhandler - to easier identify and fix these cases. I added that particular try/catch when identifying that the save/restore active slot was faulty for RevG, ans so the GUI tried to set Slot 9 active at some point. I'll correct this to prevent such cases and send a PR soon.