Skip to content

Instantly share code, notes, and snippets.

@kareblak
Created January 9, 2013 14:17
Show Gist options
  • Save kareblak/4493441 to your computer and use it in GitHub Desktop.
Save kareblak/4493441 to your computer and use it in GitHub Desktop.
val intent = TryCatch({
case e: IllegalArgumentException => logger.warn(e.getMessage, e); BadRequest ~> ResponseString(e.getMessage)
case e: UnsupportedOperationException => logger.warn(e.getMessage, e); NotImplemented ~> ResponseString(e.getMessage)
case e => logger.error(e.getMessage, e); InternalServerError
}).apply(intentImpl)
private lazy val intentImpl: Plan.Intent = {
@kareblak
Copy link
Author

kareblak commented Jan 9, 2013

vil bare slenge inn noe likt:
private val httpsIntent: Plan.Intent = {
case req@ContextPath(_) => req match {
case XHttps(h) if h == "true" => req
case _ => req
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment