pantheon-systems / solr-power

A WordPress plugin to connect to Pantheon's Apache Solr search infrastructure, or your own!
https://wordpress.org/plugins/solr-power/
GNU General Public License v2.0
126 stars 61 forks source link

Issue #397: parse h1 tags in solr error response #407

Closed pavellishin closed 5 years ago

pavellishin commented 5 years ago

The <title> tags typically don't have any useful diagnostic information, but the <h1> tags do - so parse those out first!

danielbachhuber commented 5 years ago

@pavellishin I wouldn't be bothered by mocking Solarium for this. You could abstract the parsing logic to a dedicated method if you wanted to write some simple unit tests for it.

pavellishin commented 5 years ago

@danielbachhuber that's not a bad idea. I think I'd still want to add a test to ensure that SolrPower_Sync::post returning false invokes the error handler, but yanking that out would make it more easily extensible if there's more useful error messaging we can yank out of a response.

danielbachhuber commented 5 years ago

@pavellishin On second thought, I think this PR looks fine as-is. Are you happy with it?

pavellishin commented 5 years ago

@danielbachhuber yeah - I think your suggestion about pulling code out is good, but I could spend hours making little fixes forever :)