-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
52 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,17 @@ | ||
class ErrorsController < ApplicationController | ||
layout "error" | ||
layout "errors" | ||
|
||
def show | ||
@exception = request.env["action_dispatch.exception"] | ||
@status_code = @exception.try(:status_code) || | ||
ActionDispatch::ExceptionWrapper.new( | ||
request.env, @exception | ||
).status_code | ||
|
||
render view_for_code(@status_code), status: @status_code | ||
def not_found | ||
render "404" | ||
end | ||
|
||
private | ||
def view_for_code(code) | ||
supported_error_codes.fetch(code, "404") | ||
end | ||
def fatal | ||
render "500" | ||
end | ||
|
||
def not_allowed | ||
render "422" | ||
end | ||
|
||
def supported_error_codes | ||
{ | ||
403 => "403", | ||
404 => "404", | ||
500 => "500" | ||
} | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
<div class="min-h-full bg-black px-4 py-16 sm:px-6 sm:py-24 md:grid md:place-items-center lg:px-8"> | ||
<div class="mx-auto max-w-max"> | ||
<main class="sm:flex"> | ||
<p class="text-4xl font-bold tracking-tight text-brand-600 sm:text-5xl">500</p> | ||
<div class="sm:ml-6"> | ||
<div class="sm:border-l sm:border-gray-200 sm:pl-6"> | ||
<h1 class="text-4xl font-bold tracking-tight text-gray-700 dark:text-gray-100 sm:text-5xl"> | ||
<%= gettext("Access denied") %> | ||
</h1> | ||
<p class="mt-1 text-base text-gray-500 dark:text-gray-300"> | ||
<%= gettext("Please check the URL in the address bar and try again.") %> | ||
</p> | ||
</div> | ||
<div class="mt-10 flex space-x-3 sm:border-l sm:border-transparent sm:pl-6"> | ||
<a | ||
href="/" | ||
class="inline-flex items-center rounded-md border border-transparent bg-brand-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-brand-700 focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2" | ||
> | ||
<%= gettext("Go back home") %> | ||
</a> | ||
<a | ||
href="#" | ||
class="inline-flex items-center rounded-md border border-transparent bg-brand-100 px-4 py-2 text-sm font-medium text-brand-700 hover:bg-brand-200 focus:outline-none focus:ring-2 focus:ring-brand-500 focus:ring-offset-2" | ||
> | ||
<%= gettext("Contact support") %> | ||
</a> | ||
</div> | ||
</div> | ||
</main> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.