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

net.spals.appbuilder.app.examples.finatra.sample.web.SampleFinatraExceptionMapper.scala Maven / Gradle / Ivy

package net.spals.appbuilder.app.examples.finatra.sample.web

import com.google.common.annotations.VisibleForTesting
import com.google.inject.Inject
import com.twitter.finagle.http.{Request, Response}
import com.twitter.finatra.http.exceptions.ExceptionMapper
import com.twitter.finatra.http.response.ResponseBuilder
import net.spals.appbuilder.annotations.service.AutoBindSingleton

/**
  * A sample Finatra [[ExceptionMapper]]
  *
  * @author tkral
  */
@AutoBindSingleton
@VisibleForTesting
/*private[finatra]*/ class SampleFinatraExceptionMapper @Inject() (
  response: ResponseBuilder
) extends ExceptionMapper[Throwable] {

  override def toResponse(request: Request, throwable: Throwable): Response = {
    response.internalServerError.response
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy