Skip to content

Commit

Permalink
Refactor exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
bierbaum committed Nov 12, 2010
1 parent 5b6d092 commit cdfe65c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/scala/com/twitter/finagle/thrift/ThriftCodec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import org.jboss.netty.channel.{
SimpleChannelHandler, ChannelHandlerContext,
MessageEvent, ChannelEvent, Channels}

import com.twitter.finagle.channel.TooManyDicksOnTheDanceFloorException

import ChannelBufferConversions._

/**
Expand Down Expand Up @@ -91,7 +93,6 @@ abstract class ThriftCodec extends SimpleChannelHandler {
}


class RequestConcurrencyException extends Exception
class UnrecognizedResponseException extends Exception

class ThriftServerCodec extends ThriftCodec {
Expand Down Expand Up @@ -180,7 +181,7 @@ class ThriftClientCodec extends ThriftCodec {
m getMessage match {
case call: ThriftCall[_, _] =>
if (!currentCall.compareAndSet(null, call)) {
val exc = new RequestConcurrencyException
val exc = new TooManyDicksOnTheDanceFloorException
Channels.fireExceptionCaught(ctx, exc)
c.getFuture.setFailure(exc)
return
Expand Down

0 comments on commit cdfe65c

Please sign in to comment.