]> git.basschouten.com Git - openhab-addons.git/commitdiff
[epsonprojector] Log invalid number when expecting numeric response from projector...
authormlobstein <michael.lobstein@gmail.com>
Sat, 15 Oct 2022 07:35:14 +0000 (02:35 -0500)
committerGitHub <noreply@github.com>
Sat, 15 Oct 2022 07:35:14 +0000 (09:35 +0200)
* Log invalid number when expecting numeric response from projector

Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
bundles/org.openhab.binding.epsonprojector/src/main/java/org/openhab/binding/epsonprojector/internal/EpsonProjectorDevice.java

index 27bd0869cb17f8dfcffd122491e6d53c37ad4248..22db88f927e01c5cb2662db2ce02ea7d455006dc 100644 (file)
@@ -178,7 +178,12 @@ public class EpsonProjectorDevice {
             str = subStr[0];
         }
 
-        return Integer.parseInt(str, radix);
+        try {
+            return Integer.parseInt(str, radix);
+        } catch (NumberFormatException nfe) {
+            throw new EpsonProjectorCommandException(
+                    "Unable to parse response '" + str + "' as Integer for command: " + query);
+        }
     }
 
     protected int queryInt(String query, int timeout) throws EpsonProjectorCommandException, EpsonProjectorException {