Skip to content

Commit

Permalink
Log Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvin-chappell committed Jun 4, 2015
1 parent 8f5e780 commit 40fb669
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions commercial/app/model/commercial/CapiAgent.scala
@@ -1,12 +1,12 @@
package model.commercial

import common.AkkaAgent
import common.{AkkaAgent, Logging}
import model.Content

import scala.concurrent.{ExecutionContext, Future}
import scala.util.control.NonFatal

object CapiAgent {
object CapiAgent extends Logging {

private lazy val shortUrlAgent = AkkaAgent[Map[String, Option[Content]]](Map.empty)

Expand Down Expand Up @@ -36,7 +36,9 @@ object CapiAgent {
Lookup.contentByShortUrls(shortUrlIds) flatMap {
addToCache
} recoverWith {
case NonFatal(e) => Future.successful(cache)
case NonFatal(e) =>
log.error(s"Lookup failed: ${e.getMessage}")
Future.successful(cache)
}
}

Expand Down

0 comments on commit 40fb669

Please sign in to comment.