diff --git a/app/assets/images/logos/houdini-logo.svg b/app/assets/images/logos/houdini-logo.svg new file mode 100644 index 000000000..9e200b8be --- /dev/null +++ b/app/assets/images/logos/houdini-logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/controllers/errors_controller.rb b/app/controllers/errors_controller.rb new file mode 100644 index 000000000..01b004a94 --- /dev/null +++ b/app/controllers/errors_controller.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later +# Full license explanation at https://github.com/houdiniproject/houdini/blob/main/LICENSE + +class ErrorsController < ActionController::Base + def not_found + render status: 404 + end + + def internal_server_error + render status: 500 + end + + def unprocessable + render status: 422 + end +end \ No newline at end of file diff --git a/public/500.html b/app/views/errors/internal_server.html.erb old mode 100755 new mode 100644 similarity index 68% rename from public/500.html rename to app/views/errors/internal_server.html.erb index d72a4351a..4e18221fd --- a/public/500.html +++ b/app/views/errors/internal_server.html.erb @@ -1,6 +1,10 @@ - +<%# app/views/errors/internal_server.html.erb %> + +<%- # License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later +# Full license explanation at https://github.com/houdiniproject/houdini/blob/main/LICENSE -%> + - + CommitChange - 500 @@ -10,7 +14,7 @@
- + <%= image_tag '/app/assets/images/logos/houdini-logo', alt:"Houdini logo" %>

Oops... something went wrong.

diff --git a/public/404.html b/app/views/errors/not_found.html.erb old mode 100755 new mode 100644 similarity index 69% rename from public/404.html rename to app/views/errors/not_found.html.erb index bd0ba4de2..e9915c395 --- a/public/404.html +++ b/app/views/errors/not_found.html.erb @@ -1,6 +1,10 @@ - +<%# app/views/errors/not_found.html.erb %> + +<%- # License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later +# Full license explanation at https://github.com/houdiniproject/houdini/blob/main/LICENSE -%> + - + Houdini Project - 404 @@ -10,7 +14,7 @@
- + <%= image_tag '/app/assets/images/logos/houdini-logo', alt:"Houdini logo" %>

Oops... couldn't find that page.

@@ -46,4 +50,3 @@

Oops... couldn't find that page.

transform: translateY(-50%); } - diff --git a/public/422.html b/app/views/errors/unprocessable.html.erb old mode 100755 new mode 100644 similarity index 69% rename from public/422.html rename to app/views/errors/unprocessable.html.erb index 4a79fd0fa..0d10d08c7 --- a/public/422.html +++ b/app/views/errors/unprocessable.html.erb @@ -1,6 +1,10 @@ - +<%# app/views/errors/unprocessable.html.erb %> + +<%- # License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later +# Full license explanation at https://github.com/houdiniproject/houdini/blob/main/LICENSE -%> + - + Houdini Project - 422 @@ -10,7 +14,7 @@
- + <%= image_tag '/app/assets/images/logos/houdini-logo', alt:"Houdini logo" %>

Oops... that request can't be processed.

diff --git a/config/application.rb b/config/application.rb index 7586fcb07..9a7e13f21 100755 --- a/config/application.rb +++ b/config/application.rb @@ -98,6 +98,8 @@ class Application < Rails::Application config.active_job.queue_adapter = :good_job + config.exceptions_app = self.routes + # this works around a bug where the the webpacker proxy # only waits 60 seconds for a compilation to happen. That's not # fast enough on startup and Webpacker doesn't allow us to override. diff --git a/config/routes.rb b/config/routes.rb index 903da0a7e..fbc258d3c 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -290,6 +290,13 @@ get '/css/donate-button.css' => 'widget#v1_css' get '/css/donate-button.v2.css' => 'widget#v2_css' + # Error Routes + + get '/404', to: 'errors#not_found' + get '/422', to: 'errors#unprocessable' + get '/500', to: 'errors#internal_server' + + scope ActiveStorage.routes_prefix do get "/blobs/redirect/:signed_id/*filename" => "active_storage/blobs/redirect#show", as: :rails_service_blob get "/blobs/proxy/:signed_id/*filename" => "active_storage/blobs/proxy#show", as: :rails_service_blob_proxy