I want to pass an implicit parameter to a partial function I use to recover
my Future
s.
def delete(id: Long) = ... { implicit something =>
serviceLayer.doSomething(id).recover(errorHandler)
}
def errorHandler: PartialFunction[Throwable, Result] = {
// I want to access the implicit parameter here
case e@SomeException(message) => ... and here
case _ => ... and here
}
Then your errorHandler
needs to receive something
as an implicit parameter:
def delete(id: Long) = ... { implicit something =>
serviceLayer.doSomething(id).recover(errorHandler)
}
def errorHandler(implicit something: Something): PartialFunction[Throwable, Result] = {
// Access something here
case e@SomeException(message) => ... and here
case _ => ... and here
}