Skip to content

Commit

Permalink
New errors controller
Browse files Browse the repository at this point in the history
  • Loading branch information
vertism committed Sep 24, 2024
1 parent 13fa8b1 commit 1ea6b5f
Show file tree
Hide file tree
Showing 25 changed files with 54 additions and 1,713 deletions.
Binary file removed app/assets/images/govuk_logotype_email.png
Binary file not shown.
Binary file removed app/assets/images/moj_logotype_email.png
Binary file not shown.
9 changes: 9 additions & 0 deletions app/controllers/errors_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class ErrorsController < ApplicationController
def not_found
render status: :not_found
end

def internal_error
render status: :internal_server_error
end
end
6 changes: 6 additions & 0 deletions app/views/errors/internal_error.erb.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="govuk-width-container">
<main class="govuk-main-wrapper" id="main-content" role="main">
<h1 class="govuk-heading-l">Sorry, there is a problem with the service</h1>
<p>Please contact<br><a href="mailto:[email protected]?subject=500 error report">[email protected]</a> with the details to report this issue.</p>
</main>
</div>
8 changes: 8 additions & 0 deletions app/views/errors/not_found.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="govuk-width-container">
<main class="govuk-main-wrapper" id="main-content" role="main">
<h1 class="govuk-heading-l">Page not found</h1>
<p class="govuk-body">If you typed the web address, check it is correct.</p>
<p class="govuk-body">If you pasted the web address, check you copied the entire address.</p>
<p class="govuk-body">If the web address is correct or you selected a link or button, please contact <a href="mailto:[email protected]" class="govuk-link">[email protected]</a> with the details to report this issue.</p>
</main>
</div>
8 changes: 4 additions & 4 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@

get "/accessibility" => "pages#accessibility"

get "ping", to: "heartbeat#ping", format: :json
get "ping", to: "heartbeat#ping", format: :json
get "healthcheck", to: "heartbeat#healthcheck", as: "healthcheck", format: :json

get "healthcheck", to: "heartbeat#healthcheck", as: "healthcheck", format: :json
get "/404", to: "errors#not_found"
get "/500", to: "errors#internal_error"

root to: "correspondence#start"

# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
end
95 changes: 0 additions & 95 deletions public/400.html

This file was deleted.

95 changes: 0 additions & 95 deletions public/401.html

This file was deleted.

Loading

0 comments on commit 1ea6b5f

Please sign in to comment.