Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

package org.coursera.naptime.actions


import com.typesafe.scalalogging.StrictLogging
import java.nio.charset.StandardCharsets
import org.coursera.naptime.model.KeyFormat
import org.coursera.naptime.RestError
import org.coursera.naptime.NaptimeActionException
Expand Down Expand Up @@ -60,7 +63,7 @@ import scala.util.control.NonFatal
* TODO(saeta): Enforce RACType extends from RestActionCategory.
*/
trait RestAction[RACType, AuthType, BodyType, KeyType, ResourceType, ResponseType]
extends EssentialAction with RequestTaggingHandler {
extends EssentialAction with RequestTaggingHandler with StrictLogging {

import play.api.libs.concurrent.Execution.Implicits.defaultContext

Expand Down Expand Up @@ -162,8 +165,14 @@ trait RestAction[RACType, AuthType, BodyType, KeyType, ResourceType, ResponseTyp
// If it was an auth error, override with that. Otherwise serve the body error.
authResult.map { authResult =>
authResult.fold(
error => error.result, // TODO: log?
successAuth => bodyError) // TODO: log?
authError => authError.result,
_ => {
bodyError.body.run(Iteratee.consume[Array[Byte]]()).map { bytes =>
logger.warn(
s"${new String(bytes, StandardCharsets.UTF_8)} on request ${rh.uri}")
}
bodyError
})
}
case Right(a) =>
authResult.flatMap { authResult =>
Expand Down
2 changes: 1 addition & 1 deletion version.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version in ThisBuild := "0.8.3"
version in ThisBuild := "0.8.4"