private BatchResult createBatchResult ( RESTResponse response , DBObjectBatch dbObjBatch ) { // See what kind of message payload, if any, we received. BatchResult result = null ; if ( response . getCode ( ) . isError ( ) ) { String errMsg = response . getBody ( ) ; if ( errMsg . length ( ) == 0 ) { errMsg = "Unknown error; response code=" + response . getCode ( ) ; } result = BatchResult . newErrorResult ( errMsg ) ; } else { result = new BatchResult ( getUNodeResult ( response ) ) ; copyObjectIDsToBatch ( result , dbObjBatch ) ; } return result ; }
Extract the BatchResult from the given RESTResponse . Could be an error .