Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
import org.openhab.binding.ecovacs.internal.api.impl.dto.response.portal.PortalIotCommandXmlResponse;
import org.openhab.binding.ecovacs.internal.api.impl.dto.response.portal.PortalIotProductResponse;
import org.openhab.binding.ecovacs.internal.api.impl.dto.response.portal.PortalLoginResponse;
import org.openhab.binding.ecovacs.internal.api.util.DataParsingException;
import org.openhab.binding.ecovacs.internal.api.util.HashUtil;
import org.openhab.core.OpenHAB;
import org.slf4j.Logger;
Expand Down Expand Up @@ -306,7 +305,7 @@ public <T> T sendIotCommand(Device device, DeviceDescription desc, IotDeviceComm
}
try {
return command.convertResponse(commandResponse, desc.protoVersion, gson);
} catch (DataParsingException e) {
} catch (Exception e) {
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catching generic Exception is overly broad and may mask unexpected errors that shouldn't be recoverable (like OutOfMemoryError or other serious JVM errors). Consider catching RuntimeException instead, or at minimum catching specific exceptions like NullPointerException, IllegalStateException, and keeping the existing specific exceptions. This allows truly exceptional errors to propagate properly while still catching the parsing and data-related runtime exceptions mentioned in the PR description.

Suggested change
} catch (Exception e) {
} catch (RuntimeException e) {

Copilot uses AI. Check for mistakes.
logger.debug("Converting response for command {} failed", command, e);
throw new EcovacsApiException(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import org.openhab.binding.ecovacs.internal.api.impl.dto.response.portal.PortalLoginResponse;
import org.openhab.binding.ecovacs.internal.api.model.CleanLogRecord;
import org.openhab.binding.ecovacs.internal.api.model.DeviceCapability;
import org.openhab.binding.ecovacs.internal.api.util.DataParsingException;
import org.openhab.core.io.net.http.TrustAllTrustManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -179,7 +178,7 @@ public void connect(final EventListener listener, ScheduledExecutorService sched
String eventName = receivedTopic.split("/")[2].toLowerCase();
logger.trace("{}: Got MQTT message on topic {}: {}", getSerialNumber(), receivedTopic, payload);
parser.handleMessage(eventName, payload);
} catch (DataParsingException e) {
} catch (Exception e) {
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catching generic Exception is overly broad and may mask unexpected errors that shouldn't be recoverable (like OutOfMemoryError or other serious JVM errors). Consider catching RuntimeException instead, or at minimum catching specific exceptions like NullPointerException, IllegalStateException, and keeping the existing specific exceptions. This allows truly exceptional errors to propagate properly while still catching the parsing and data-related runtime exceptions mentioned in the PR description.

Suggested change
} catch (Exception e) {
} catch (RuntimeException e) {

Copilot uses AI. Check for mistakes.
listener.onEventStreamFailure(this, e);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public <T> T sendCommand(IotDeviceCommand<T> command) throws EcovacsApiException
return command.convertResponse(responseObj, ProtocolVersion.XML, gson);
}
}
} catch (DataParsingException | ParserConfigurationException | TransformerException e) {
} catch (Exception e) {
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Catching generic Exception is overly broad and may mask unexpected errors that shouldn't be recoverable (like OutOfMemoryError or other serious JVM errors). Consider catching RuntimeException instead, or at minimum catching specific exceptions like NullPointerException, IllegalStateException, and keeping the existing specific exceptions. This allows truly exceptional errors to propagate properly while still catching the parsing and data-related runtime exceptions mentioned in the PR description.

Suggested change
} catch (Exception e) {
} catch (RuntimeException e) {

Copilot uses AI. Check for mistakes.
throw new EcovacsApiException(e);
}

Expand Down
Loading