Blacklight Plugin

catalog controller, index action recursive redirect if solr http error occurs

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.4
  • Fix Version/s: 2.5
  • Component/s: None
  • Description:
    Hide
    If a solr connection error is thrown, BL redirects endlessly. This is because it's capturing an RSolr::RequestError. RSolr needs to throw a connection exception, and then BL could handle properly. BL could also test the connection at boot time and throw a meaningful error.
    Show
    If a solr connection error is thrown, BL redirects endlessly. This is because it's capturing an RSolr::RequestError. RSolr needs to throw a connection exception, and then BL could handle properly. BL could also test the connection at boot time and throw a meaningful error.

Activity

Hide
Jonathan Rochkind added a comment - 06/Apr/10 8:33 PM
You know, the more I think about this, the more I think the current behavior of redirecting to home page (with a 200 HTTP status!) when a 'fatal' (caught at top level) error is encountered -- is just bad behavior in the first place. I'm always annoyed when vendors web apps do that (typically because I'm trying to screen scrape them, which hopefully nobody will have to do with Blacklight, but still, it's just bad web behavior).

Jessie, or anyone else, what do you think about having an un-caught top-level error simply display an actual error page (and return an HTTP 500 response code), instead of redirecting to home page at all? The error page could include a link back to the home page still.

But this seems like better behavior to me, AND will make the endless redirect go away as a byproduct.

What do you think?

[ Longer term, to REALLY be a good web citizen, many of those uncaught errors ought to be caught at the right place, and have the properly meaningful 4xx code displayed. For instance, a show URL to a document ID that doesn't exist should give a 404 with a more specific error message, not a 500 "something bad happened". But that's for a different ticket than this one, just mentioning it for thought. ]
Show
Jonathan Rochkind added a comment - 06/Apr/10 8:33 PM You know, the more I think about this, the more I think the current behavior of redirecting to home page (with a 200 HTTP status!) when a 'fatal' (caught at top level) error is encountered -- is just bad behavior in the first place. I'm always annoyed when vendors web apps do that (typically because I'm trying to screen scrape them, which hopefully nobody will have to do with Blacklight, but still, it's just bad web behavior). Jessie, or anyone else, what do you think about having an un-caught top-level error simply display an actual error page (and return an HTTP 500 response code), instead of redirecting to home page at all? The error page could include a link back to the home page still. But this seems like better behavior to me, AND will make the endless redirect go away as a byproduct. What do you think? [ Longer term, to REALLY be a good web citizen, many of those uncaught errors ought to be caught at the right place, and have the properly meaningful 4xx code displayed. For instance, a show URL to a document ID that doesn't exist should give a 404 with a more specific error message, not a 500 "something bad happened". But that's for a different ticket than this one, just mentioning it for thought. ]
Hide
Jessie Keck added a comment - 03/May/10 12:37 PM
Methods in CatalogController now used and can be overridden at the application level.
Returning 500 for solr error and 404 for invalid solr id.
Show
Jessie Keck added a comment - 03/May/10 12:37 PM Methods in CatalogController now used and can be overridden at the application level. Returning 500 for solr error and 404 for invalid solr id.

People

Dates

  • Created:
    26/Jan/10 1:09 PM
    Updated:
    03/May/10 12:37 PM
    Resolved:
    03/May/10 12:37 PM