-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Handling gracefully upload failure #4794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The current method of reporting upload errors is based on an exoteric combination of exceptions which makes return error code useless The Uploader.java message() implementation is too avrdude-dependant to allow easy portability since the upload tools are becoming a lot and very different With this commit we try to avoid exceptions and only use the external uploader's exit code to decide the status bar message. The message can be: - the last line containing "error" string (any case) or - the usual avrdude message parsing (to keep compatibility with translations) Needs testing with all platform and all supported upload tools
✅ Build completed.
Please test this code using one of the following:
⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-4794-BUILD-536-linux32.tar.xz
⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-4794-BUILD-536-linux64.tar.xz
⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-4794-BUILD-536-windows.zip
⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-4794-BUILD-536-macosx.zip
⬇️ http://downloads.arduino.cc/javaide/pull_requests/arduino-PR-4794-BUILD-536-linuxarm.tar.xz
i️ The linuxarm
build is still experimental and may not be always available.
Handling gracefully upload failure
The current code to handle upload failures if quite old and too avrdude dependant.
Actually, the 101 sketchUploader triggers a funny situation with strings being replaced and displayed with nonsense results.
This PR handles these situations by returning gracefully (without generating an exception) and then deciding which is the "right" string to display.