
The page you were looking for doesn't exist.
-You may have mistyped the address or the page may have moved.
+Not found
If you are the application owner check the logs for more information.
-+ The page you requested could not be found. +
+ + +diff --git a/Gemfile b/Gemfile index bdc17a3dc..d75f25b0a 100644 --- a/Gemfile +++ b/Gemfile @@ -97,6 +97,10 @@ gem 'mini_magick', '~> 4.11' # manually add this gem to enable questioning_authority to parse linked-data results gem 'linkeddata', '~> 3.1.6' +# Generate non-digested copies of application.css and application.js +# (allows us to reference assets in the static error pages) +gem 'non-digest-assets', '~> 2.2.0' + # system monitoring gem 'okcomputer', '~> 1.18.4' diff --git a/Gemfile.lock b/Gemfile.lock index ad0fb49e1..1f500455e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -642,8 +642,9 @@ GEM nokogiri (1.15.3) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.15.3-arm64-darwin) - racc (~> 1.4) + non-digest-assets (2.2.0) + activesupport (>= 5.2, < 7.1) + sprockets (>= 2.0, < 5.0) oai (0.4.0) builder (>= 3.1.0) faraday @@ -1087,6 +1088,7 @@ DEPENDENCIES linkeddata (~> 3.1.6) listen (>= 3.0.5, < 3.8) mini_magick (~> 4.11) + non-digest-assets (~> 2.2.0) okcomputer (~> 1.18.4) pg (~> 1.2.3) puma (~> 6.1.1) @@ -1116,4 +1118,4 @@ DEPENDENCIES webmock (~> 3.8) BUNDLED WITH - 2.4.14 + 2.4.7 diff --git a/app/controllers/error_controller.rb b/app/controllers/error_controller.rb deleted file mode 100644 index daeb747df..000000000 --- a/app/controllers/error_controller.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true -class ErrorController < ApplicationController - before_action :set_status - - respond_to :html - - def show - respond_to do |format| - format.html { render @status.to_s, status: @status.to_i } - format.json { render json: json_response, status: @status.to_i } - format.text { render plain: plain_text_response, status: @status.to_i } - end - rescue - send_honeybadger_notification! - - # fallback for statuses that we haven't created a view for - render '500', status: :internal_server_error - end - - private - - def json_response - %({"error": true, "status": #{@status.to_i}, "message": "#{status_message}"}) - end - - def plain_text_response - "#{@status} #{status_message}" - end - - def status_message - Rack::Utils::HTTP_STATUS_CODES.fetch(@status, '') - end - - def send_honeybadger_notification! - Honeybadger.notify( - 'An error occurred causing a 500 page to render', - backtrace: @exception.full_trace, - controller: self.class.name.to_s, - action: action_name, - parameters: params - ) - end - - def set_status - backtrace_cleaner = request.env['action_dispatch.backtrace_cleaner'] - raw_exception = request.env['action_dispatch.exception'] - @exception = ActionDispatch::ExceptionWrapper.new(backtrace_cleaner, raw_exception) - @status = @exception.status_code - - # hyrax's dashboard_helper_behavior is expecting this to be defined from a route - params[:controller] = self.class.name.to_s - end -end diff --git a/app/views/error/404.html.erb b/app/views/error/404.html.erb deleted file mode 100644 index a6a2df6c8..000000000 --- a/app/views/error/404.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -<% provide(:page_title) { t('spot.error.404.page_title', name: application_name) } %> - -<%= image_tag('404-splash.jpg', class: 'img-responsive') %> - -
- The page you requested could not be found. -
diff --git a/app/views/error/500.html.erb b/app/views/error/500.html.erb deleted file mode 100644 index d8b779ecf..000000000 --- a/app/views/error/500.html.erb +++ /dev/null @@ -1,11 +0,0 @@ -<% provide(:page_title) { t('spot.error.500.page_title', name: application_name) } %> - -<%= image_tag('500-splash.jpg', class: 'img-responsive') %> - -- Well this is embarrassing! We've encountered an error with your request. -
diff --git a/config/environments/production.rb b/config/environments/production.rb index 8433d18a9..f3faa27f4 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -103,10 +103,6 @@ # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false - # use our error_controller to render error pages - # (see: https://stackoverflow.com/a/24239490) - config.exceptions_app = ->(env) { ErrorController.action(:show).call(env) } - # use ssl for everything config.force_ssl = true end diff --git a/public/404.html b/public/404.html index 2be3af26f..0629b72e7 100644 --- a/public/404.html +++ b/public/404.html @@ -1,67 +1,110 @@ - - -