1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-03-13 10:29:35 +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:
Cristian Maglie 2014-11-20 14:00:43 +01:00
parent 85aecfe0da
commit 257238c050
2 changed files with 9 additions and 14 deletions

View File

@ -2573,7 +2573,8 @@ public class Editor extends JFrame implements RunnerListener {
statusError(I18n.format(
_("Error while burning bootloader: missing '{0}' configuration parameter"),
e.getMessage()));
//statusError(e);
} catch (RunnerException e) {
statusError(e.getMessage());
} catch (Exception e) {
statusError(_("Error while burning bootloader."));
e.printStackTrace();

View File

@ -322,19 +322,13 @@ public class SerialUploader extends Uploader {
prefs.put("bootloader.verbose", prefs.getOrExcept("bootloader.params.quiet"));
}
try {
String pattern = prefs.getOrExcept("erase.pattern");
String[] cmd = StringReplacer.formatAndSplit(pattern, prefs, true);
if (!executeUploadCommand(cmd))
return false;
String pattern = prefs.getOrExcept("erase.pattern");
String[] cmd = StringReplacer.formatAndSplit(pattern, prefs, true);
if (!executeUploadCommand(cmd))
return false;
pattern = prefs.getOrExcept("bootloader.pattern");
cmd = StringReplacer.formatAndSplit(pattern, prefs, true);
return executeUploadCommand(cmd);
} catch (RunnerException e) {
throw e;
} catch (Exception e) {
throw new RunnerException(e);
}
pattern = prefs.getOrExcept("bootloader.pattern");
cmd = StringReplacer.formatAndSplit(pattern, prefs, true);
return executeUploadCommand(cmd);
}
}