Commit de93c0ff9196f01f0be0cfdea7d325ecf313d7fa
1 parent
ef651028
Exists in
master
Better handling of errors from selectserial, using logger
Showing
1 changed file
with
6 additions
and
2 deletions
Show diff stats
robots/little_john/telemetry/code/monitor/graph_plotter_rewrite.py
| ... | ... | @@ -26,10 +26,14 @@ logging.info("Logging system active") |
| 26 | 26 | datafeed = selectserial() |
| 27 | 27 | |
| 28 | 28 | if type(datafeed) is str: |
| 29 | - easygui.msgbox("Failed to open serial port:\n" + datafeed, "Fatal error") | |
| 29 | + message = "Failed to open serial port:\n" + datafeed | |
| 30 | + easygui.msgbox(message, "Fatal error") | |
| 31 | + logging.critical(message) | |
| 30 | 32 | sys.exit() |
| 31 | 33 | elif datafeed == None: |
| 32 | - easygui.msgbox("Failed to open serial port for unknown reason!", "Fatal error") | |
| 34 | + message = "Failed to open serial port for unknown reason!" | |
| 35 | + easygui.msgbox(message, "Fatal error") | |
| 36 | + logging.critical(message) | |
| 33 | 37 | sys.exit() |
| 34 | 38 | |
| 35 | 39 | if platform.system()=='Windows': #easier than passing vars | ... | ... |