From f1b7586930bf1e5027c23d59818a08ee4e3b665d Mon Sep 17 00:00:00 2001
From: Sergi Hernandez Juan <shernand@iri.upc.edu>
Date: Thu, 15 Nov 2018 12:10:14 +0100
Subject: [PATCH] Thrown an exception if there are no FTDI devices available.

---
 src/usb_i2c.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/usb_i2c.cpp b/src/usb_i2c.cpp
index 8eef91a..409161b 100644
--- a/src/usb_i2c.cpp
+++ b/src/usb_i2c.cpp
@@ -61,6 +61,11 @@ void CUSBI2C::open(const std::string &serial)
       throw CUSBI2CException(_HERE_,"No FTDI device available with the desired serial number.");
     }
   }
+  else
+  {
+    /* handle exceptions */
+    throw CUSBI2CException(_HERE_,"No FTDI devices available.");
+  }
 }
 
 unsigned char CUSBI2C::get_revision(void)
-- 
GitLab