[ 
https://issues.apache.org/jira/browse/OAK-3821?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15067915#comment-15067915
 ] 

Thomas Mueller commented on OAK-3821:
-------------------------------------

Suggested patch:

{noformat}
Index: 
src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/OakDirectory.java
===================================================================
--- 
src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/OakDirectory.java  
    (revision 1719342)
+++ 
src/main/java/org/apache/jackrabbit/oak/plugins/index/lucene/OakDirectory.java  
    (working copy)
@@ -382,7 +382,9 @@
             // seek() may be called with pos == length
             // see https://issues.apache.org/jira/browse/LUCENE-1196
             if (pos < 0 || pos > length) {
-                throw new IOException("Invalid seek request");
+                String msg = String.format("Invalid seek request for [%s], " + 
+                        "position: %d, length: %d, pos: %d", name, position, 
length, pos);
+                throw new IOException(msg);                
             } else {
                 position = pos;
             }
@@ -393,8 +395,8 @@
             checkPositionIndexes(offset, offset + len, checkNotNull(b).length);
 
             if (len < 0 || position + len > length) {
-                String msg = String.format("Invalid byte range request [%s] : 
position : %d, length : " +
-                                "%d, len : %d", name, position, length, len);
+                String msg = String.format("Invalid byte range request for 
[%s], " + 
+                        "position: %d, length: %d, len: %d", name, position, 
length, len);
                 throw new IOException(msg);
             }
 
{noformat}


> Lucene directory: improve exception message
> -------------------------------------------
>
>                 Key: OAK-3821
>                 URL: https://issues.apache.org/jira/browse/OAK-3821
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: lucene, query
>            Reporter: Thomas Mueller
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to