From 39b41379ee5bc08b907179d3bcd71a1591dbc365 Mon Sep 17 00:00:00 2001 From: Edan Schwartz Date: Tue, 17 Jan 2023 20:16:48 -0600 Subject: [PATCH] Log all exceptions in upload.py (#8813) Currently some exceptions cause a exit code 2, but without any relevant error message. As an example, I had an issue with my USB drivers. But the only message I saw using the Arduino IDE was: uploading error: exit status 2. With this code change I could see a more specific Resource busy error message, which helped me identify the actual problem. --- tools/upload.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/upload.py b/tools/upload.py index aee6add8f..760d4dbbe 100755 --- a/tools/upload.py +++ b/tools/upload.py @@ -65,7 +65,7 @@ if erase_addr: try: esptool.main(cmdline) -except esptool.FatalError as e: +except Exception as e: sys.stderr.write('\nA fatal esptool.py error occurred: %s' % e) finally: if erase_file: