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

add getRequiredParameter() to SolrParams

    Details

    • Type: Wish
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2
    • Component/s: None
    • Labels:
      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. SOLR-183-required-param.patch
          0.9 kB
          Ryan McKinley
        2. SOLR-183-required-param.patch
          11 kB
          Ryan McKinley
        3. SOLR-183-required-param.patch
          13 kB
          Ryan McKinley
        4. SOLR-183-required-param.patch
          16 kB
          J.J. Larrea
        5. SOLR-183-required-param.patch
          17 kB
          Ryan McKinley
        6. RequiredSolrParams.java
          5 kB
          J.J. Larrea

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: