You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Andrei Dulceanu (Jira)" <ji...@apache.org> on 2023/02/02 10:12:00 UTC

[jira] [Created] (OAK-10101) Improve exception message when retrieving String properties

Andrei Dulceanu created OAK-10101:
-------------------------------------

             Summary: Improve exception message when retrieving String properties
                 Key: OAK-10101
                 URL: https://issues.apache.org/jira/browse/OAK-10101
             Project: Jackrabbit Oak
          Issue Type: Task
          Components: segment-tar
    Affects Versions: 1.48.0
            Reporter: Andrei Dulceanu
            Assignee: Andrei Dulceanu
             Fix For: 1.50.0


If we have a property of type {{BINARIES}} and we try to read it, using the Oak API, as an array of {{{}STRING{}}}, then the exception message of the correctly raised {{IllegalStateException}} is:
{noformat}
java.lang.IllegalStateException: String is too long: 2325884045577463478" (where the number is basically random) {noformat}
In order to give a hint to the caller about what might go wrong, we should improve the exception message:
{noformat}
throw new IllegalStateException("String is too long: " + length + "; possibly trying to read a BLOB using getString; can not convert BLOB to String");   {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)