mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-15 12:29:26 +01:00
IDE: better error handling for upload/burn bootloader
RunnerException was displayed with an ugly stacktrace, while the message contained in the exception itself is already quite enough detailed and clear.
This commit is contained in:
parent
85aecfe0da
commit
257238c050
@ -2573,7 +2573,8 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
statusError(I18n.format(
|
statusError(I18n.format(
|
||||||
_("Error while burning bootloader: missing '{0}' configuration parameter"),
|
_("Error while burning bootloader: missing '{0}' configuration parameter"),
|
||||||
e.getMessage()));
|
e.getMessage()));
|
||||||
//statusError(e);
|
} catch (RunnerException e) {
|
||||||
|
statusError(e.getMessage());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
statusError(_("Error while burning bootloader."));
|
statusError(_("Error while burning bootloader."));
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
@ -322,19 +322,13 @@ public class SerialUploader extends Uploader {
|
|||||||
prefs.put("bootloader.verbose", prefs.getOrExcept("bootloader.params.quiet"));
|
prefs.put("bootloader.verbose", prefs.getOrExcept("bootloader.params.quiet"));
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
String pattern = prefs.getOrExcept("erase.pattern");
|
||||||
String pattern = prefs.getOrExcept("erase.pattern");
|
String[] cmd = StringReplacer.formatAndSplit(pattern, prefs, true);
|
||||||
String[] cmd = StringReplacer.formatAndSplit(pattern, prefs, true);
|
if (!executeUploadCommand(cmd))
|
||||||
if (!executeUploadCommand(cmd))
|
return false;
|
||||||
return false;
|
|
||||||
|
|
||||||
pattern = prefs.getOrExcept("bootloader.pattern");
|
pattern = prefs.getOrExcept("bootloader.pattern");
|
||||||
cmd = StringReplacer.formatAndSplit(pattern, prefs, true);
|
cmd = StringReplacer.formatAndSplit(pattern, prefs, true);
|
||||||
return executeUploadCommand(cmd);
|
return executeUploadCommand(cmd);
|
||||||
} catch (RunnerException e) {
|
|
||||||
throw e;
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new RunnerException(e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user