import org.slf4j.LoggerFactory;
import com.google.gson.Gson;
+import com.google.gson.JsonSyntaxException;
/**
* The {@link OrbitBhyveBridgeHandler} is responsible for handling commands, which are
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
"Get devices returned response status: " + response.getStatus());
}
+ } catch (JsonSyntaxException e) {
+ logger.debug("Exception parsing devices json: {}", e.getMessage(), e);
+ updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Error parsing devices json");
} catch (TimeoutException | ExecutionException e) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Error during getting devices");
} catch (InterruptedException e) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
"Returned status: " + response.getStatus());
}
+ } catch (JsonSyntaxException e) {
+ logger.debug("Exception parsing device json: {}", e.getMessage(), e);
+ updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Error parsing device json");
} catch (TimeoutException | ExecutionException e) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR,
"Error during getting device info: " + deviceId);
import java.util.List;
import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
+import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.annotations.SerializedName;
@SerializedName("last_connected_at")
String lastConnectedAt = "";
- JsonObject location = new JsonObject();
+ @Nullable
+ JsonElement location = null;
@SerializedName("suggested_start_time")
String suggestedStartTime = "";