better hide exception messages
parent
f7fbafab7c
commit
506ab83dff
|
@ -28,7 +28,7 @@ final class ErrorHandler(
|
|||
lila.mon.http.error(actionName, client, req.method, 500).increment()
|
||||
lila.log("http").error(s"ERROR 500 $actionName", exception)
|
||||
if (canShowErrorPage(req))
|
||||
InternalServerError(views.html.base.errorPage(exception) {
|
||||
InternalServerError(views.html.site.bits.errorPage {
|
||||
lila.api.Context.error(
|
||||
req,
|
||||
lila.i18n.defaultLang,
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
package views.html
|
||||
package base
|
||||
|
||||
import lila.api.Context
|
||||
import lila.app.ui.ScalatagsTemplate._
|
||||
|
||||
import controllers.routes
|
||||
|
||||
object errorPage {
|
||||
|
||||
def apply(ex: Throwable)(implicit ctx: Context) =
|
||||
layout(
|
||||
title = "Internal server error"
|
||||
) {
|
||||
main(cls := "page-small box box-pad")(
|
||||
h1("Something went wrong on this page"),
|
||||
p(
|
||||
"If the problem persists, please ",
|
||||
a(href := s"${routes.Main.contact}#help-error-page")("report the bug"),
|
||||
"."
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ package views.html.site
|
|||
import lila.api.Context
|
||||
import lila.app.templating.Environment._
|
||||
import lila.app.ui.ScalatagsTemplate._
|
||||
import controllers.routes
|
||||
|
||||
object bits {
|
||||
|
||||
|
@ -38,4 +39,18 @@ object bits {
|
|||
</body>
|
||||
</html>"""
|
||||
)
|
||||
|
||||
def errorPage(implicit ctx: Context) =
|
||||
views.html.base.layout(
|
||||
title = "Internal server error"
|
||||
) {
|
||||
main(cls := "page-small box box-pad")(
|
||||
h1("Something went wrong on this page"),
|
||||
p(
|
||||
"If the problem persists, please ",
|
||||
a(href := s"${routes.Main.contact}#help-error-page")("report the bug"),
|
||||
"."
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue