mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
set response status code before creating exception template (#468)
This commit is contained in:
parent
ced34b7651
commit
b8ec6ee328
1 changed files with 2 additions and 1 deletions
|
@ -22,13 +22,14 @@ def render_404
|
||||||
end
|
end
|
||||||
|
|
||||||
def render_500(context, exception, verbosity)
|
def render_500(context, exception, verbosity)
|
||||||
|
context.response.status_code = 500
|
||||||
|
|
||||||
template = if verbosity
|
template = if verbosity
|
||||||
Kemal::ExceptionPage.for_runtime_exception(context, exception).to_s
|
Kemal::ExceptionPage.for_runtime_exception(context, exception).to_s
|
||||||
else
|
else
|
||||||
Kemal::ExceptionPage.for_production_exception
|
Kemal::ExceptionPage.for_production_exception
|
||||||
end
|
end
|
||||||
|
|
||||||
context.response.status_code = 500
|
|
||||||
context.response.print template
|
context.response.print template
|
||||||
context
|
context
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue