Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在开发环境中,play 框架很好地显示了堆栈跟踪的异常。但是当我将它移到生产环境时,它只显示异常 ID。如何在产品的错误页面上至少显示异常消息?
您可以捕获异常并显示您想要的任何内容:
object Global extends GlobalSettings { override def onError(request: RequestHeader, ex: Throwable) = { InternalServerError( views.html.errorPage(ex) ) } }
查看官方文档 和默认错误页面!