use of com.ctrip.xpipe.exception.XpipeException in project x-pipe by ctripcorp.
the class NettySlaveHandler method doChannelRead.
@Override
protected void doChannelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
ByteBuf byteBuf = (ByteBuf) msg;
byteBufReadPolicy.read(ctx.channel(), byteBuf, new ByteBufReadAction() {
@Override
public void read(Channel channel, ByteBuf byteBuf) throws ByteBufReadActionException {
try {
redisMasterReplication.handleResponse(channel, byteBuf);
} catch (XpipeException e) {
throw new ByteBufReadActionException("handle:" + channel, e);
}
}
});
}
use of com.ctrip.xpipe.exception.XpipeException in project x-pipe by ctripcorp.
the class AsyncSendEmailCommandTest method testAsyncSendEmailCommand.
@Test
public void testAsyncSendEmailCommand() throws Exception {
when(client.sendEmail(any())).thenThrow(new XpipeException("test exception"));
CtripPlatformEmailService.AsyncSendEmailCommand command = new CtripPlatformEmailService.AsyncSendEmailCommand(generateEmail());
command.setClient(client);
CommandFuture future = command.execute();
Assert.assertFalse(future.isSuccess());
Assert.assertEquals("test exception", future.cause().getMessage());
}
Aggregations