You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@eventmesh.apache.org by GitBox <gi...@apache.org> on 2022/12/14 04:12:32 UTC

[GitHub] [incubator-eventmesh] jonyangx commented on a diff in pull request #2584: [ISSUE #2519]Merge the exception catched statement

jonyangx commented on code in PR #2584:
URL: https://github.com/apache/incubator-eventmesh/pull/2584#discussion_r1047996683


##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/utils/IPUtils.java:
##########
@@ -104,12 +104,9 @@ public static String getLocalAddress() {
             //If failed to find,fall back to localhost
             final InetAddress localHost = InetAddress.getLocalHost();
             return normalizeHostAddress(localHost);
-        } catch (SocketException e) {
-            LOG.error("socket exception", e);
-        } catch (UnknownHostException e) {
-            LOG.error("unknown host exception", e);
+        } catch (SocketException | UnknownHostException e) {
+            LOG.error(e.getMessage());

Review Comment:
   suggest log error with exception object ,not message



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: dev-help@eventmesh.apache.org