From 2915468a53d04e2c8143a42b733eb402012cfe08 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Thu, 3 Aug 2023 17:51:26 +0200 Subject: [PATCH] Use ErrorSeverity.elementBody() in RestconfError ErrorSeverity provides the element body through a dedicated method, do to use toLowerCase(). Change-Id: I5a036dc65de8b798f2dd0eb1121f27f00c4752c7 Signed-off-by: Robert Varga (cherry picked from commit 6151f0444151183903debc231039dbf3183cd560) (cherry picked from commit 6c23b4e0c9965dc54001ff9ad22568ab10f6bb34) --- .../opendaylight/restconf/common/errors/RestconfError.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/errors/RestconfError.java b/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/errors/RestconfError.java index 0919c08fb8..4a4d94499a 100644 --- a/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/errors/RestconfError.java +++ b/restconf/restconf-common/src/main/java/org/opendaylight/restconf/common/errors/RestconfError.java @@ -10,7 +10,6 @@ package org.opendaylight.restconf.common.errors; import static java.util.Objects.requireNonNull; import java.io.Serializable; -import java.util.Locale; import org.opendaylight.yangtools.yang.common.ErrorTag; import org.opendaylight.yangtools.yang.common.ErrorType; import org.opendaylight.yangtools.yang.common.RpcError; @@ -147,8 +146,7 @@ public class RestconfError implements Serializable { if (rpcError.getCause() != null) { localErrorInfo = rpcError.getCause().getMessage(); } else if (rpcError.getSeverity() != null) { - localErrorInfo = "" + rpcError.getSeverity().toString().toLowerCase(Locale.ROOT) - + ""; + localErrorInfo = "" + rpcError.getSeverity().elementBody() + ""; } } else { localErrorInfo = rpcError.getInfo(); -- 2.36.6