Skip to content

Commit 29b4f37

Browse files
author
Zaar
committed
Added changes for issue#3009.
1. Used try-with-resources along with nested try-catch to manage resources, fixing out of scope variable. 2. Added similar fix for issue#3007 and issue#3008 to fix compilation error due to out of scope variable in catch block.
1 parent 8b8dd05 commit 29b4f37

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Diff for: eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/GrpcClientHandler.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ void delete(HttpExchange httpExchange) throws IOException {
103103
Error error = new Error(e.toString(), stackTrace);
104104
String result = JsonUtils.toJSONString(error);
105105
httpExchange.sendResponseHeaders(500, result.getBytes().length);
106-
out.write(result.getBytes());
106+
107+
log.error(result, e);
107108
}
108109
}
109110

Diff for: eventmesh-runtime/src/main/java/org/apache/eventmesh/runtime/admin/handler/HTTPClientHandler.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ void delete(HttpExchange httpExchange) throws IOException {
9595
Error error = new Error(e.toString(), stackTrace);
9696
String result = JsonUtils.toJSONString(error);
9797
httpExchange.sendResponseHeaders(500, result.getBytes().length);
98-
out.write(result.getBytes());
98+
99+
log.error(result, e);
99100
}
100101
}
101102

0 commit comments

Comments
 (0)