Class: Workarea::Storefront::ErrorsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/workarea/storefront/errors_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#current_layout, #current_user_info, #health_check, #layout_content

Methods included from OrderLookup

#lookup_order, #lookup_order=

Methods included from CurrentCheckout

#clear_current_order, #completed_order, #completed_order=, #current_checkout, #current_order, #current_order=, #current_shipping, #current_shippings, #logout

Instance Method Details

#internalObject



18
19
20
21
22
23
# File 'app/controllers/workarea/storefront/errors_controller.rb', line 18

def internal
  # This ensures any exception handling (e.g. Airbrake or Sentry) will see
  # the error in their middleware, and then report on it.
  request.env['rack.exception'] = request.env['action_dispatch.exception']
  render_error_page(500)
end

#not_foundObject



6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/workarea/storefront/errors_controller.rb', line 6

def not_found
  redirect_url = Navigation::Redirect.find_destination(
    request.env['action_dispatch.original_path']
  )

  if redirect_url.present?
    redirect_to redirect_url, status: :moved_permanently
  else
    render_error_page(404)
  end
end

#offlineObject



25
26
27
28
29
30
# File 'app/controllers/workarea/storefront/errors_controller.rb', line 25

def offline
  content = Content.for('offline')
  @content = ContentViewModel.wrap(content)

  render('workarea/storefront/errors/show')
end