Remove RestconfDocumentedException.decodeAndThrow()
[netconf.git] / restconf / restconf-common / src / main / java / org / opendaylight / restconf / common / errors / RestconfDocumentedException.java
index c04d9d98e8b5ef4a3df9c7d53351622f1c98ff21..cc5f15b2bb4892cd5738cda8599b7ac9c0c687f9 100644 (file)
@@ -14,10 +14,8 @@ import java.util.Collection;
 import java.util.List;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
-import org.opendaylight.restconf.common.ErrorTags;
 import org.opendaylight.yangtools.yang.common.ErrorTag;
 import org.opendaylight.yangtools.yang.common.ErrorType;
-import org.opendaylight.yangtools.yang.common.OperationFailedException;
 import org.opendaylight.yangtools.yang.common.RpcError;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangNetconfError;
@@ -166,17 +164,6 @@ public class RestconfDocumentedException extends RuntimeException {
         modelContext = null;
     }
 
-    public static RestconfDocumentedException decodeAndThrow(final String message,
-            final OperationFailedException cause) {
-        for (final RpcError error : cause.getErrorList()) {
-            if (error.getErrorType() == ErrorType.TRANSPORT && error.getTag().equals(ErrorTag.RESOURCE_DENIED)) {
-                throw new RestconfDocumentedException(error.getMessage(), ErrorType.TRANSPORT,
-                    ErrorTags.RESOURCE_DENIED_TRANSPORT, cause);
-            }
-        }
-        throw new RestconfDocumentedException(message, cause, cause.getErrorList());
-    }
-
     /**
      * Throw an instance of this exception if an expression evaluates to true. If the expression evaluates to false,
      * this method does nothing.