jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1531895 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/blob/MongoBlobStore.java
Date Mon, 14 Oct 2013 13:45:29 GMT
Author: thomasm
Date: Mon Oct 14 13:45:28 2013
New Revision: 1531895

URL: http://svn.apache.org/r1531895
Log:
OAK-123 Data store: improved error message

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/blob/MongoBlobStore.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/blob/MongoBlobStore.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/blob/MongoBlobStore.java?rev=1531895&r1=1531894&r2=1531895&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/blob/MongoBlobStore.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/mongomk/blob/MongoBlobStore.java
Mon Oct 14 13:45:28 2013
@@ -16,6 +16,8 @@
  */
 package org.apache.jackrabbit.oak.plugins.mongomk.blob;
 
+import java.io.IOException;
+
 import org.apache.jackrabbit.mk.blobs.AbstractBlobStore;
 import org.apache.jackrabbit.mk.util.StringUtils;
 import org.slf4j.Logger;
@@ -71,6 +73,11 @@ public class MongoBlobStore extends Abst
     protected byte[] readBlockFromBackend(BlockId blockId) throws Exception {
         String id = StringUtils.convertBytesToHex(blockId.getDigest());
         MongoBlob blobMongo = getBlob(id, 0);
+        if (blobMongo == null) {
+            String message = "Did not find block " + id;
+            LOG.error(message);
+            throw new IOException(message);
+        }
         byte[] data = blobMongo.getData();
 
         if (blockId.getPos() == 0) {



Mime
View raw message