All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mle.play.GlobalErrorHandling.scala Maven / Gradle / Ivy

The newest version!
package com.mle.play

import com.mle.util.Log
import play.api.GlobalSettings
import play.api.mvc.{RequestHeader, Result}

import scala.concurrent.Future

/**
 *
 * @author mle
 */
trait GlobalErrorHandling extends GlobalSettings with Log {

  override def onError(request: RequestHeader, ex: Throwable): Future[Result] = {
    def src = request.remoteAddress
    def path = request.path
    def exName = ex.getClass.getName
    log.warn(s"Unhandled $exName for request to: $path from: $src", ex)
    super.onError(request, ex)
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy