From b5bfe08bd2c6f45d6762fad4cc9337063406d92a Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Tue, 13 Nov 2018 10:38:05 +0100 Subject: [PATCH] Better error for 'no serial ports available' See https://github.com/arduino/Arduino/pull/8194#issuecomment-438180384 --- app/src/processing/app/Editor.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/src/processing/app/Editor.java b/app/src/processing/app/Editor.java index 043b72855..5a53e90bd 100644 --- a/app/src/processing/app/Editor.java +++ b/app/src/processing/app/Editor.java @@ -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"),