From e8a5858c15c2710cf2bd51b904144a326cf0f946 Mon Sep 17 00:00:00 2001 From: Daniel Orner Date: Sun, 10 Nov 2024 10:36:17 -0500 Subject: [PATCH] 4765: Go back to default Rails error handling --- app/controllers/errors_controller.rb | 9 - app/views/errors/insufficient.html.erb | 3 - .../errors/internal_server_error.html.erb | 28 -- app/views/errors/not_found.html.erb | 31 --- config/application.rb | 1 - config/routes.rb | 3 - public/403.html | 256 +++++++++++++---- public/404.html | 257 ++++++++++++++---- public/422.html | 257 ++++++++++++++---- public/500.html | 253 +++++++++++++---- 10 files changed, 817 insertions(+), 281 deletions(-) delete mode 100644 app/controllers/errors_controller.rb delete mode 100644 app/views/errors/insufficient.html.erb delete mode 100644 app/views/errors/internal_server_error.html.erb delete mode 100644 app/views/errors/not_found.html.erb diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb deleted file mode 100644 index e1a0fc6892..0000000000 --- a/app/controllers/errors_controller.rb +++ /dev/null @@ -1,9 +0,0 @@ -class ErrorsController < ApplicationController - def not_found - render status: :not_found - end - - def internal_server_error - render status: :internal_server_error - end -end \ No newline at end of file diff --git a/app/views/errors/insufficient.html.erb b/app/views/errors/insufficient.html.erb deleted file mode 100644 index 85f844732c..0000000000 --- a/app/views/errors/insufficient.html.erb +++ /dev/null @@ -1,3 +0,0 @@ -

Insufficient Supply

- -

You don't have enough of those to do that :(

diff --git a/app/views/errors/internal_server_error.html.erb b/app/views/errors/internal_server_error.html.erb deleted file mode 100644 index bfedf09242..0000000000 --- a/app/views/errors/internal_server_error.html.erb +++ /dev/null @@ -1,28 +0,0 @@ -
-
-
-
-

500 Error Page

-
-
- -
-
-
-
- -
-
-

500

-
-
-

Oops! Something went wrong.

-

- We will work on fixing that right away. -

-
-
-
diff --git a/app/views/errors/not_found.html.erb b/app/views/errors/not_found.html.erb deleted file mode 100644 index 12c3302ee4..0000000000 --- a/app/views/errors/not_found.html.erb +++ /dev/null @@ -1,31 +0,0 @@ -
-
-
-
-

404 Error Page

-
-
- -
-
-
-
- - -
-
-

404

-
-
-

Oops! Page not found.

- -

- We could not find the page you were looking for. -

- -
-
-
diff --git a/config/application.rb b/config/application.rb index 783b8c2f02..bd3480a205 100644 --- a/config/application.rb +++ b/config/application.rb @@ -19,7 +19,6 @@ class Application < Rails::Application config.load_defaults 7.0 config.legacy_connection_handling = false config.action_dispatch.return_only_media_type_on_content_type = false - config.exceptions_app = routes config.active_job.queue_adapter = :delayed_job diff --git a/config/routes.rb b/config/routes.rb index 7a6c552856..161941480f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -86,9 +86,6 @@ def set_up_flipper end end - match "/404", to: "errors#not_found", via: :all - match "/500", to: "errors#internal_server_error", via: :all - resources :users do get :switch_to_role, on: :collection post :partner_user_reset_password, on: :collection diff --git a/public/403.html b/public/403.html index e3af451eb5..63ffb8baf6 100644 --- a/public/403.html +++ b/public/403.html @@ -1,66 +1,220 @@ - + - The page you were looking for is forbidden (403) - - + + + + +
+ + + + + +
+ - - -
-

The page you were looking for is forbidden.

+
+
+
+
+

403 Error Page

+
+
+ +
+
+
+
+ + +
+
+

403

+
+
+

Oops! The page you were looking for is forbidden.

+ +

+ You don't have access to this page. +

+

+
+
+
+
-

If you are the application owner check the logs for more information.

+ + + + +
+
+ + + diff --git a/public/404.html b/public/404.html index b612547fc2..410e1424bc 100644 --- a/public/404.html +++ b/public/404.html @@ -1,67 +1,220 @@ - + - The page you were looking for doesn't exist (404) - - + + + + +
+ + + + + +
+ - - -
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

+
+
+
+
+

404 Error Page

+
+
+ +
-

If you are the application owner check the logs for more information.

+
+ + +
+
+

404

+
+
+

Oops! Page not found.

+ +

+ We could not find the page you were looking for. +

+ +
+
+
+ +
+
+ + + + +
+
+ + + diff --git a/public/422.html b/public/422.html index a21f82b3bd..f0fdc49bd8 100644 --- a/public/422.html +++ b/public/422.html @@ -1,67 +1,220 @@ - + - The change you wanted was rejected (422) - - + + + + +
+ + + + + +
+ - - -
-

The change you wanted was rejected.

-

Maybe you tried to change something you didn't have access to.

+
+
+
+
+

422 Error Page

+
+
+ +
+
+
+
+ + +
+
+

422

+
+
+

Oops! The change you wanted was rejected.

+

+ Maybe you tried to change something you didn't have access to. +

+

-

If you are the application owner check the logs for more information.

+
+ +
+
+ + + + +
+
+ + + + diff --git a/public/500.html b/public/500.html index 061abc587d..9578136f7e 100644 --- a/public/500.html +++ b/public/500.html @@ -1,66 +1,217 @@ - + - We're sorry, but something went wrong (500) - - + + + + +
+ + + + + +
+ - - -
-

We're sorry, but something went wrong.

+
+
+
+
+

500 Error Page

+
+
+ +
+
+
+
+ +
+
+

500

+
+
+

Oops! Something went wrong.

+

+ We will work on fixing that right away. +

+
+
+
+
-

If you are the application owner check the logs for more information.

+ + + + +
+
+ + +