From 08a161f45d092b036c1aef87a009dddf27e1693d Mon Sep 17 00:00:00 2001 From: Rik Veenboer Date: Thu, 14 Jul 2016 08:44:27 +0100 Subject: [PATCH] Log error instead of exception to try other COM ports --- src/main/java/com/github/boukefalos/arduino/port/Port.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/github/boukefalos/arduino/port/Port.java b/src/main/java/com/github/boukefalos/arduino/port/Port.java index f72eff2..cde9f10 100644 --- a/src/main/java/com/github/boukefalos/arduino/port/Port.java +++ b/src/main/java/com/github/boukefalos/arduino/port/Port.java @@ -83,7 +83,8 @@ public class Port implements SerialPortEventListener { System.out.println("Connected on port: " + portid.getName()); serialPort.addEventListener(this); } catch (UnsupportedCommOperationException | PortInUseException | IOException | TooManyListenersException e) { - throw new ArduinoException("Failed to connect"); + logger.error("", new ArduinoException("Failed to connect")); + continue; } serialPort.notifyOnDataAvailable(true); return;