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

add getRequiredParameter() to SolrParams

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Wish
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 1.2
    • None
    • None

    Description

      I find myself including this with every patch, so i'll just separate it out. This simply adds a utilty function to SolrParams that throws a 400 if the parameter is missing:

      /** returns the value of the param, or throws a 400 exception if missing */
      public String getRequiredParameter(String param) throws SolrException {
      String val = get(param);
      if( val == null )

      { throw new SolrException( 400, "Missing parameter: "+param ); }

      return val;
      }

      Attachments

        1. RequiredSolrParams.java
          5 kB
          J.J. Larrea
        2. SOLR-183-required-param.patch
          17 kB
          Ryan McKinley
        3. SOLR-183-required-param.patch
          16 kB
          J.J. Larrea
        4. SOLR-183-required-param.patch
          13 kB
          Ryan McKinley
        5. SOLR-183-required-param.patch
          11 kB
          Ryan McKinley
        6. SOLR-183-required-param.patch
          0.9 kB
          Ryan McKinley

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            ryantxu Ryan McKinley
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment