Skip to content

Commit ef8d669

Browse files
committed
Don't report an exception if waitForUploadPort fails after successfull upload
Fixes #8851
1 parent 99f6043 commit ef8d669

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: arduino-core/src/cc/arduino/packages/uploaders/SerialUploader.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ public boolean uploadUsingPreferences(File sourcePath, String buildPath, String
210210

211211
// Reuse waitForUploadPort for this task, but this time we are simply waiting
212212
// for one port to reappear. If no port reappears before the timeout, actualUploadPort is selected
213-
finalUploadPort = waitForUploadPort(actualUploadPort, Serial.list(), false);
213+
finalUploadPort = waitForUploadPort(actualUploadPort, Serial.list(), false, 2000);
214214
}
215-
} catch (InterruptedException ex) {
215+
} catch (RunnerException ex) {
216216
// noop
217217
}
218218
}
@@ -229,13 +229,13 @@ public boolean uploadUsingPreferences(File sourcePath, String buildPath, String
229229
}
230230

231231
private String waitForUploadPort(String uploadPort, List<String> before) throws InterruptedException, RunnerException {
232-
return waitForUploadPort(uploadPort, before, verbose);
232+
return waitForUploadPort(uploadPort, before, verbose, 10000);
233233
}
234234

235-
private String waitForUploadPort(String uploadPort, List<String> before, boolean verbose) throws InterruptedException, RunnerException {
235+
private String waitForUploadPort(String uploadPort, List<String> before, boolean verbose, int timeout) throws InterruptedException, RunnerException {
236236
// Wait for a port to appear on the list
237237
int elapsed = 0;
238-
while (elapsed < 10000) {
238+
while (elapsed < timeout) {
239239
List<String> now = Serial.list();
240240
List<String> diff = new ArrayList<>(now);
241241
diff.removeAll(before);

0 commit comments

Comments
 (0)