Skip to content

Commit 8884d3b

Browse files
authored
Update ExceptionPage and fix the error title. Fixes #1920 (#1921)
1 parent 7cc4a89 commit 8884d3b

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

shard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ dependencies:
4747
version: ~> 0.4.3
4848
exception_page:
4949
github: crystal-loot/exception_page
50-
version: ~> 0.4.1
50+
version: ~> 0.5.0
5151
dexter:
5252
github: luckyframework/dexter
5353
version: ~> 0.3.4

src/lucky/error_action.cr

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,19 @@ abstract class Lucky::ErrorAction
7979
end
8080

8181
def render_exception_page(error : Exception, status : Int) : Lucky::Response
82+
exception_page = Lucky::ExceptionPage.new(
83+
error,
84+
context.request.method,
85+
context.request.path,
86+
context.response.status,
87+
"Error #{context.response.status.to_i} #{context.response.status.description}",
88+
context.request.query_params,
89+
context.response.headers,
90+
context.response.cookies,
91+
error.message,
92+
)
8293
send_text_response(
83-
body: Lucky::ExceptionPage.new(context, error).to_s,
94+
body: exception_page.to_s,
8495
content_type: "text/html",
8596
status: status
8697
)

0 commit comments

Comments
 (0)