gerlowskija commented on PR #2788:
URL: https://github.com/apache/solr/pull/2788#issuecomment-2462819695
> I added one new unit test [...] using a generated SolrJ API [...] but the
invocation of the client API (new
ClusterPropertiesApi.GetClusterProperty("ext.clusterPropThatDoesNotExist").process(client))
does not throw an exception as I had expected, so the unit test fails. [...] I
gather the correct changes to api.mustache would make the generated code throw
an exception in the right case.
*sigh* No it's not a template problem - I think you've uncovered a design
implication I hadn't realized up until now.
In short - SolrClients typically parse the response into a "NamedList" that
is then immediately inspected to see whether there were any server errors that
should result in a client-side exception. But for these generated v2 classes,
the response-parsing happens much much later - nothing gets parsed until the
caller has already received a SolrResponse instance and invokes a special
`getParsed()` method. Which unintentionally side-steps SolrClient's
response-inspection and exception throwing logic entirely, without giving it
any sort of replacement.
It's fixable, but definitely beyond the scope of what we'd want to bring
into this PR. I've created a separate JIRA ticket to discuss more:
https://issues.apache.org/jira/browse/SOLR-17549
In the meantime - forget I said anything about having tests that use the
generated SolrJ objects. I'd love to backfill those tests later once we've
worked out some of the kinks in how the generated classes need to work, but
that shouldn't block this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]