Log invalid number when expecting numeric response from projector (#13549)
Signed-off-by: Michael Lobstein <michael.lobstein@gmail.com>
This commit is contained in:
parent
c29c0b4c86
commit
f5101b1764
|
@ -92,7 +92,12 @@ public class BenqProjectorDevice {
|
||||||
|
|
||||||
protected int queryInt(String query) throws BenqProjectorCommandException, BenqProjectorException {
|
protected int queryInt(String query) throws BenqProjectorCommandException, BenqProjectorException {
|
||||||
String response = sendQuery(query);
|
String response = sendQuery(query);
|
||||||
return Integer.parseInt(response);
|
try {
|
||||||
|
return Integer.parseInt(response);
|
||||||
|
} catch (NumberFormatException nfe) {
|
||||||
|
throw new BenqProjectorCommandException(
|
||||||
|
"Unable to parse response '" + response + "' as Integer for command: " + query);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String queryString(String query) throws BenqProjectorCommandException, BenqProjectorException {
|
protected String queryString(String query) throws BenqProjectorCommandException, BenqProjectorException {
|
||||||
|
|
Loading…
Reference in New Issue