Skip to content

Commit

Permalink
Use prettier 404 page for missing catalog pages (#2501)
Browse files Browse the repository at this point in the history
* Use prettier 404 page for missing catalog pages

* Enable exceptions to test for 404

Co-authored-by: Harpo <[email protected]>
  • Loading branch information
afred and mrharpo authored Dec 22, 2022
1 parent c83437a commit 0eb9bbb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ def index
def show
# From BlacklightGUIDFetcher
@response, @document = fetch_from_solr(params['id'])
# we have to rescue from this in fetch_from_solr to run through all guid permutations, so throw it here if we didnt find anything
raise Blacklight::Exceptions::RecordNotFound unless @document
# If we didn't end up getting a @document, 404
raise ActionController::RoutingError.new('Not Found') unless @document

xml = @document['xml']
respond_to do |format|
Expand Down
2 changes: 1 addition & 1 deletion config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
config.action_controller.perform_caching = false

# Raise exceptions instead of rendering exception templates.
config.action_dispatch.show_exceptions = false
config.action_dispatch.show_exceptions = true

# Disable request forgery protection in test environment.
config.action_controller.allow_forgery_protection = false
Expand Down

0 comments on commit 0eb9bbb

Please sign in to comment.