[ 
https://issues.apache.org/jira/browse/SOLR-17316?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18116447#comment-18116447
 ] 

ASF subversion and git services commented on SOLR-17316:
--------------------------------------------------------

Commit 5777608633038cc57693fa8622260ef54416b687 in solr's branch 
refs/heads/branch_10x from Serhiy Bzhezytskyy
[ https://gitbox.apache.org/repos/asf?p=solr.git;h=57776086330 ]

SOLR-17316: fix ApiTool and PackageUtils to fail on non-2xx responses (#4914)

`bin/solr api` and the package manager's collection-agnostic API calls now fail 
on a non-2xx response instead of printing it as if it had succeeded.

InputStreamResponseParser now incorporates a "reason" with the status.  A 
checkStatus() method helps callers handle errors.

Co-authored-by: Claude Sonnet 5 <[email protected]>
(cherry picked from commit 10a2cb044e0320f0b63be7917f2742f5fff5e361)


> SolrResponseBase getters should work with all ResponseParsers 
> --------------------------------------------------------------
>
>                 Key: SOLR-17316
>                 URL: https://issues.apache.org/jira/browse/SOLR-17316
>             Project: Solr
>          Issue Type: Bug
>          Components: SolrJ
>    Affects Versions: 9.6.1, 10.0
>            Reporter: Jason Gerlowski
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 6h
>  Remaining Estimate: 0h
>
> SolrJ's SolrResponseBase has several "getter" methods that give users a 
> syntactic sugar for accessing common response properties (such as the 
> response header's "status" field).  These methods are useful, but make 
> certain Java class/type assumptions that only hold for some of Solr's 
> ResponseParsers.
> For example, "SolrResponseBase.getResponseHeader" returns a NamedList - which 
> is correct when the default "BinaryResponseParser" is used, but will cause a 
> ClassCastException when used with other parsers (e.g. JsonMapResponseParser)
> We have a few options for how to remedy this:
> 1. Make these SolrResponseBase methods a little more flexible in the types 
> they return and the variety of types they can handle as they walk the 
> response NamedList
> 2. Try to align all ResponseParser implementations around using types 
> similarly.
> 3. If (1) and (2) are infeasible, we could at least add Javadocs to these 
> SolrResponseBase methods to indicate that they may throw CCE, and that 
> they're only guaranteed to work with the BinaryResponseParser.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to