deviceContext.unhookRequestCtx(getRequestContext().getXid());
// handle requestContext failure
- StringBuilder rpcErrors = new StringBuilder();
- if (null != fRpcResult.getErrors() && fRpcResult.getErrors().size() > 0) {
- for (RpcError error : fRpcResult.getErrors()) {
- rpcErrors.append(error.getMessage());
+ if (LOG.isTraceEnabled()) {
+ StringBuilder rpcErrors = new StringBuilder();
+ if (null != fRpcResult.getErrors() && fRpcResult.getErrors().size() > 0) {
+ for (RpcError error : fRpcResult.getErrors()) {
+ rpcErrors.append(error.getMessage());
+ LOG.trace("Errors from rpc result.. ",error);
+ }
}
+ LOG.trace("OF Java result for XID {} was not successful. Errors : {}", getRequestContext().getXid().getValue(), rpcErrors.toString());
+
}
- LOG.trace("OF Java result for XID {} was not successful. Errors : {}", getRequestContext().getXid().getValue(), rpcErrors.toString());
+
getRequestContext().getFuture().set(
RpcResultBuilder.<O>failed().withRpcErrors(fRpcResult.getErrors()).build());
RequestContextUtil.closeRequstContext(getRequestContext());
@Override
public void onFailure(final Throwable throwable) {
getMessageSpy().spyMessage(input.getImplementedInterface(), MessageSpy.STATISTIC_GROUP.TO_SWITCH_SUBMIT_FAILURE);
+ LOG.trace("Flow modification failed..", throwable);
StringBuffer errors = new StringBuffer();
try {
RpcResult<Void> result = future.get();
}
} catch (InterruptedException | ExecutionException e) {
LOG.trace("Flow modification failed. Can't read errors from RpcResult.");
+ } finally {
+ LOG.trace("Flow modification failed. Errors : {}", errors.toString());
}
- LOG.trace("Flow modification failed. Errors : {}", errors.toString());
}
});
return future;