1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

Better error for 'no serial ports available'

See https://github.com/arduino/Arduino/pull/8194#issuecomment-438180384
This commit is contained in:
Cristian Maglie 2018-11-13 10:38:05 +01:00 committed by Cristian Maglie
parent 2647ce36ea
commit b5bfe08bd2

View File

@ -2036,9 +2036,15 @@ public class Editor extends JFrame implements RunnerListener {
statusNotice(tr("Done uploading."));
}
} catch (SerialNotFoundException e) {
if (portMenu.getItemCount() == 0) statusError(e);
else if (serialPrompt()) run();
else statusNotice(tr("Upload canceled."));
if (portMenu.getItemCount() == 0) {
statusError(tr("Serial port not selected."));
} else {
if (serialPrompt()) {
run();
} else {
statusNotice(tr("Upload canceled."));
}
}
} catch (PreferencesMapException e) {
statusError(I18n.format(
tr("Error while uploading: missing '{0}' configuration parameter"),