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

com.twitter.finagle.mux.stats.MuxCancelledCategorizer.scala Maven / Gradle / Ivy

There is a newer version: 6.39.0
Show newest version
package com.twitter.finagle.mux.stats

import com.twitter.finagle.mux.ClientDiscardedRequestException
import com.twitter.finagle.stats.CancelledCategorizer
import com.twitter.util.Throwables.RootCause

/**
 * Matcher for Throwables caused by a ClientDiscardedRequestException.
 */
object MuxCancelledCategorizer {
  def unapply(exc: Throwable): Option[ClientDiscardedRequestException] = {
    exc match {
      case t: ClientDiscardedRequestException => Some(t)
      case RootCause(MuxCancelledCategorizer(t)) => Some(t)
      case _ => None
    }
  }

  val Instance: PartialFunction[Throwable, String] = {
    case MuxCancelledCategorizer(_) => CancelledCategorizer.Cancelled
  }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy