diff --git a/CHANGELOG b/CHANGELOG index e08c01d..035d9ce 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ 2022-02-13 * Better article ID parsing +* Link to full Medium URL on error page 2022-02-12 diff --git a/src/actions/articles/show.cr b/src/actions/articles/show.cr index 7bd1e30..15b65a7 100644 --- a/src/actions/articles/show.cr +++ b/src/actions/articles/show.cr @@ -12,8 +12,8 @@ class Articles::Show < BrowserAction html( Errors::ParseErrorPage, message: "Error parsing the URL", - status_code: 500, - original_path: request.path, + status_code: 422, + original_resource: request.resource, ) end end diff --git a/src/pages/errors/parse_error_page.cr b/src/pages/errors/parse_error_page.cr index 5e99ace..2207ec2 100644 --- a/src/pages/errors/parse_error_page.cr +++ b/src/pages/errors/parse_error_page.cr @@ -1,7 +1,7 @@ class Errors::ParseErrorPage < MainLayout needs message : String needs status_code : Int32 - needs original_path : String + needs original_resource : String def page_title "Error" @@ -25,7 +25,7 @@ class Errors::ParseErrorPage < MainLayout TEXT para do text "If you like, you can try visiting " - a "this page on medium.com", href: "https://medium.com#{original_path}" + a "this page on medium.com", href: "https://medium.com#{original_resource}" end end end