Permalink
Browse files

Avoid exceptions in default error handler.

The toString method on Req will throw if it contains files that are too
large for the configured limits
  • Loading branch information...
1 parent 0ffc21c commit 666bc55018b6bdcaffc45c5914d7da4d75c2055d @jeppenejsum jeppenejsum committed with fmpwizard Dec 12, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 web/webkit/src/main/scala/net/liftweb/http/LiftRules.scala
@@ -1391,11 +1391,11 @@ class LiftRules() extends Factory with FormVendor with LazyLoggable {
*/
val exceptionHandler = RulesSeq[ExceptionHandlerPF].append {
case (Props.RunModes.Development, r, e) =>
- logger.error("Exception being returned to browser when processing " + r.uri.toString + ": " + showException(e))
+ logger.error("Exception being returned to browser when processing " + r.uri.toString, e)
XhtmlResponse((<html> <body>Exception occured while processing {r.uri}<pre>{showException(e)}</pre> </body> </html>), S.htmlProperties.docType, List("Content-Type" -> "text/html; charset=utf-8"), Nil, 500, S.ieMode)
case (_, r, e) =>
- logger.error("Exception being returned to browser when processing " + r, e)
+ logger.error("Exception being returned to browser when processing " + r.uri.toString, e)
XhtmlResponse((<html> <body>Something unexpected happened while serving the page at {r.uri}</body> </html>), S.htmlProperties.docType, List("Content-Type" -> "text/html; charset=utf-8"), Nil, 500, S.ieMode)
}

0 comments on commit 666bc55

Please sign in to comment.