X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=restconf%2Frestconf-nb-bierman02%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fsal%2Frestconf%2Fimpl%2FJSONRestconfServiceImpl.java;h=19cba39740e9f397d486f06d93907fbc0339a888;hb=0cc245d37ebbe6d9d5933bcb0034a1ed9c5b093a;hp=bb2b25d33028258421043a854ff777e91ff82dc9;hpb=276fb1df2ffee67a9ee7fb5e7c9a78d1cb62bdc8;p=netconf.git diff --git a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/JSONRestconfServiceImpl.java b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/JSONRestconfServiceImpl.java index bb2b25d330..19cba39740 100644 --- a/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/JSONRestconfServiceImpl.java +++ b/restconf/restconf-nb-bierman02/src/main/java/org/opendaylight/netconf/sal/restconf/impl/JSONRestconfServiceImpl.java @@ -40,7 +40,6 @@ import org.opendaylight.restconf.common.patch.PatchStatusContext; import org.opendaylight.restconf.common.util.SimpleUriInfo; import org.opendaylight.yangtools.yang.common.OperationFailedException; import org.opendaylight.yangtools.yang.common.RpcError; -import org.opendaylight.yangtools.yang.common.RpcError.ErrorType; import org.opendaylight.yangtools.yang.common.RpcResultBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -284,27 +283,10 @@ public class JSONRestconfServiceImpl implements JSONRestconfService { final RpcError[] to = new RpcError[from.size()]; int index = 0; for (final RestconfError e: from) { - to[index++] = RpcResultBuilder.newError(toRpcErrorType(e.getErrorType()), e.getErrorTag().getTagValue(), + to[index++] = RpcResultBuilder.newError(e.getErrorType().toLegacy(), e.getErrorTag().getTagValue(), e.getErrorMessage()); } return to; } - - private static ErrorType toRpcErrorType(final RestconfError.ErrorType errorType) { - switch (errorType) { - case TRANSPORT: { - return ErrorType.TRANSPORT; - } - case RPC: { - return ErrorType.RPC; - } - case PROTOCOL: { - return ErrorType.PROTOCOL; - } - default: { - return ErrorType.APPLICATION; - } - } - } }