Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-7170

exceptions thrown by SolrJ do not provide sufficient information to gracefully handle errors

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 4.10.3
    • None
    • SolrJ
    • None

    Description

      Currently, exceptions thrown by SolrJ are do not provide sufficient information that would enable graceful error handling. Here are some examples:

      When a Solr Collection does not exist, SolrJ throws ErrorCode.BAD_REQUEST with message "Could not find collection: " or "Could not find collection in zk: ". The only part of the exception that hints to the type of problem is the message. However, a hardcoded text message is not a reliable point of data to be used in exception handling. It would be much cleaner if SolrJ expanded its library of Error Codes and used them to specify what type of error has occurred. E.g. :
      ErrorCode.CANNOT_FIND_COLLECTION (for the above example)

      ErrorCode.NO_LIVE_NODES (instead of just SolrServerException("No live SolrServers available to handle this request"))

      ErrorCode.BAD_RESPONSE (instead of just SolrServerException("Expected JSON object in response from ...)

      etc

      Attachments

        Activity

          People

            Unassigned Unassigned
            grishick Greg Solovyev
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: