use of org.opendaylight.yangtools.yang.common.ErrorType in project netconf by opendaylight.
the class NetconfRestconfTransaction method toCommitFailedException.
@SuppressFBWarnings(value = "UPM_UNCALLED_PRIVATE_METHOD", justification = "https://github.com/spotbugs/spotbugs/issues/811")
private static TransactionCommitFailedException toCommitFailedException(final Collection<? extends RpcError> errors) {
ErrorType errType = ErrorType.APPLICATION;
ErrorSeverity errSeverity = ErrorSeverity.ERROR;
StringJoiner msgBuilder = new StringJoiner(" ");
ErrorTag errorTag = ErrorTag.OPERATION_FAILED;
for (final RpcError error : errors) {
errType = error.getErrorType().toNetconf();
errSeverity = error.getSeverity().toNetconf();
msgBuilder.add(error.getMessage());
msgBuilder.add(error.getInfo());
errorTag = new ErrorTag(error.getTag());
}
return new TransactionCommitFailedException("Netconf transaction commit failed", new NetconfDocumentedException("RPC during tx failed. " + msgBuilder.toString(), errType, errorTag, errSeverity));
}
Aggregations