Wrapper catching exceptions accured on db.run call
<p>In our project we always injecting <code>dbConfigProvider: DatabaseConfigProvider</code> in our bean objects and then doing database operations with <code>db.run(some query)</code>, it returns Future. How can I write a logging wrapper for <code>db.run</code> which will print all sql exceptions.</p>

<p><strong>Example:</strong></p>

<pre><code>class SomeBeanImpl @Inject()(dbConfigProvider: DatabaseConfigProvider) {
  private val logger = Logger(getClass)

  def someDBQuery() = {
    db.run(some wrong sql query) // exception raised in future, I need to print it with logger
  }
}
</code></pre>

<p><strong>Note:</strong>
If I add <code>.onFailure</code> on each <code>db.run</code> call it will mess up my code very badly. That's why I need write this wrapper for all of <code>db.run</code> calls.</p>

<p>If I wrap <code>db.run</code> in some function with different signature, I must change it in many places, which is not the best option. How can I do it implicitly?</p>