Solr
  1. Solr
  2. SOLR-5291

Solrj does not propagate the root cause to the user for many errors.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.6, Trunk
    • Component/s: None
    • Labels:
      None

      Description

      This is a frustrating little bug because it forces you to look at the logs for any insight into what happened - the error message in the exception you get with Solrj is very generic.

      1. SOLR-5291.patch
        10 kB
        Mark Miller

        Issue Links

          Activity

          Hide
          ASF subversion and git services added a comment -

          Commit 1527554 from Mark Miller in branch 'dev/branches/branch_4x'
          [ https://svn.apache.org/r1527554 ]

          SOLR-5291: Solrj does not propagate the root cause to the user for many errors.
          SOLR-3530: Better error messages / Content-Type validation in SolrJ.

          Show
          ASF subversion and git services added a comment - Commit 1527554 from Mark Miller in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1527554 ] SOLR-5291 : Solrj does not propagate the root cause to the user for many errors. SOLR-3530 : Better error messages / Content-Type validation in SolrJ.
          Hide
          ASF subversion and git services added a comment -

          Commit 1527547 from Mark Miller in branch 'dev/trunk'
          [ https://svn.apache.org/r1527547 ]

          SOLR-5291: Solrj does not propagate the root cause to the user for many errors.
          SOLR-3530: Better error messages / Content-Type validation in SolrJ.

          Show
          ASF subversion and git services added a comment - Commit 1527547 from Mark Miller in branch 'dev/trunk' [ https://svn.apache.org/r1527547 ] SOLR-5291 : Solrj does not propagate the root cause to the user for many errors. SOLR-3530 : Better error messages / Content-Type validation in SolrJ.
          Hide
          Mark Miller added a comment -

          The big problem here was not chained exceptions - it was more how solrj was dealing with exceptions in some cases - it had the code to do something more informative, but an earlier exception was short circuiting it.

          Show
          Mark Miller added a comment - The big problem here was not chained exceptions - it was more how solrj was dealing with exceptions in some cases - it had the code to do something more informative, but an earlier exception was short circuiting it.
          Hide
          Mark Miller added a comment -

          Here is my first pass. Also includes some content type validation for SOLR-3530.

          Show
          Mark Miller added a comment - Here is my first pass. Also includes some content type validation for SOLR-3530 .
          Hide
          Robert Muir added a comment -

          One technique I've used to hunt this kinda thing down is to temporarily "ban" Throwable.getMessage, Throwable.toString, Throwable.getLocalizedMessage, etc with forbidden-apis and then review all the places where it finds them in use:

          This finds stuff like:

          catch (FooBarException e) {
            Throw new BazException("something went wrong" + e); // discarding the root cause
          }
          
          Show
          Robert Muir added a comment - One technique I've used to hunt this kinda thing down is to temporarily "ban" Throwable.getMessage, Throwable.toString, Throwable.getLocalizedMessage, etc with forbidden-apis and then review all the places where it finds them in use: This finds stuff like: catch (FooBarException e) { Throw new BazException( "something went wrong" + e); // discarding the root cause }

            People

            • Assignee:
              Mark Miller
              Reporter:
              Mark Miller
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development