Skip to content
Closed
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
1 change: 1 addition & 0 deletions utils/src/main/java/com/cloud/utils/nio/NioClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ protected void init() throws IOException {
_selector.close();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

here as well?

throw new IOException("Failed to initialise security", e);
} catch (final IOException e) {
_clientConnection.close();
Copy link

Copilot AI Jun 5, 2025

Choose a reason for hiding this comment

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

Consider wrapping _clientConnection.close() in a try-catch block to ensure that any exception thrown during the close operation does not obscure the original IOException and to better manage resource cleanup.

Suggested change
_clientConnection.close();
try {
_clientConnection.close();
} catch (final IOException closeException) {
logger.error("Failed to close _clientConnection", closeException);
}

Copilot uses AI. Check for mistakes.
_selector.close();
throw e;
}
Expand Down