class RouteParamExtractionException extends Exception with NoStackTrace
Used to denote an exception which occurred during routing while attempting to
extract the capture value of a route param from an incoming request URI, e.g.,
for a defined route: /user/:id
, extracting the text "123" from an incoming
request URI of /user/123
.
This exception is handled by the framework but is public to allow users to customize
their server behavior via an installed ExceptionMapper over this exception type, if
desired. Note, that this exception occurs **before** routing and thus any user-defined
ExceptionMapper should be added to an ExceptionManager installed on an
com.twitter.finatra.http.filters.ExceptionMappingFilter that is installed with
beforeRouting = true
.
class RouteParamExtractionExceptionMapper extends ExceptionMapper[RouteParamExtractionException] { def toResponse(request: Request, throwable: RouteParamExtractionException): Response = ??? } ... val beforeRoutingExceptionManager: ExceptionManager = new ExceptionManager(injector, injector.instance[StatsReceiver]) beforeRoutingExceptionManager.add[RouteParamExtractionExceptionMapper] ... override def configureHttp(router: HttpRouter) { router .filter(new ExceptionMappingFilter[Request](beforeRoutingExceptionManager), beforeRouting = true) .add[MyAPIController] } // or without a custom `ExceptionManager` (uses the default configured by the `ExceptionManagerModule`): override def configureHttp(router: HttpRouter) { router .filter[ExceptionMappingFilter[Request]](beforeRouting = true) .add[MyAPIController] .exceptionMapper[RouteParamExtractionExceptionMapper] }
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- RouteParamExtractionException
- NoStackTrace
- Exception
- Throwable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def addSuppressed(arg0: Throwable): Unit
- Definition Classes
- Throwable
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def fillInStackTrace(): Throwable
- Definition Classes
- NoStackTrace → Throwable
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def getCause(): Throwable
- Definition Classes
- Throwable
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getLocalizedMessage(): String
- Definition Classes
- Throwable
- def getMessage(): String
- Definition Classes
- Throwable
- def getStackTrace(): Array[StackTraceElement]
- Definition Classes
- Throwable
- final def getSuppressed(): Array[Throwable]
- Definition Classes
- Throwable
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def initCause(arg0: Throwable): Throwable
- Definition Classes
- Throwable
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def printStackTrace(arg0: PrintWriter): Unit
- Definition Classes
- Throwable
- def printStackTrace(arg0: PrintStream): Unit
- Definition Classes
- Throwable
- def printStackTrace(): Unit
- Definition Classes
- Throwable
- def setStackTrace(arg0: Array[StackTraceElement]): Unit
- Definition Classes
- Throwable
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- Throwable → AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()