Skip to content

Commit

Permalink
updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Burnett committed Nov 20, 2012
1 parent 6eab2b1 commit ac63db2
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.markdown
Expand Up @@ -130,7 +130,13 @@ object App {
} }


error { request => error { request =>
render.status(500).plain("whoops!").toFuture request.error match {
case Some(e:ArithmeticException) =>
render.status(500).plain("whoops, divide by zero!").toFuture
case _ =>
println(request.error)
render.status(500).plain("Something went wrong!").toFuture
}
} }




Expand Down
27 changes: 27 additions & 0 deletions src/main/scala/com/twitter/finatra/ResponseAdapter.scala
@@ -0,0 +1,27 @@
/**
* Copyright (C) 2012 Twitter Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.twitter.finatra

import com.twitter.util.Future
import com.twitter.finagle.http.{Response => FinagleResponse}

object ResponseAdapter {
def apply(resp: Future[Response]) = {
resp.map(_.build)
}
}


0 comments on commit ac63db2

Please sign in to comment.