From 28205954de0da1a40706540dcd044a4750d17d04 Mon Sep 17 00:00:00 2001 From: Nikita Date: Mon, 16 Nov 2015 14:30:12 +0300 Subject: [PATCH] setFailure replaced with tryFailure --- .../org/redisson/client/handler/CommandDecoder.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/redisson/client/handler/CommandDecoder.java b/src/main/java/org/redisson/client/handler/CommandDecoder.java index 43a890120..ac11e6376 100644 --- a/src/main/java/org/redisson/client/handler/CommandDecoder.java +++ b/src/main/java/org/redisson/client/handler/CommandDecoder.java @@ -109,7 +109,7 @@ public class CommandDecoder extends ReplayingDecoder { decode(in, cmd, null, ctx.channel(), currentDecoder); // } } catch (IOException e) { - cmd.getPromise().setFailure(e); + cmd.getPromise().tryFailure(e); } } else if (data instanceof CommandsData) { CommandsData commands = (CommandsData)data; @@ -136,7 +136,7 @@ public class CommandDecoder extends ReplayingDecoder { decode(in, cmd, null, ctx.channel(), currentDecoder); i++; } catch (IOException e) { - cmd.getPromise().setFailure(e); + cmd.getPromise().tryFailure(e); } } @@ -170,17 +170,17 @@ public class CommandDecoder extends ReplayingDecoder { String[] errorParts = error.split(" "); int slot = Integer.valueOf(errorParts[1]); String addr = errorParts[2]; - data.getPromise().setFailure(new RedisMovedException(slot, addr)); + data.getPromise().tryFailure(new RedisMovedException(slot, addr)); } else if (error.startsWith("ASK")) { String[] errorParts = error.split(" "); int slot = Integer.valueOf(errorParts[1]); String addr = errorParts[2]; - data.getPromise().setFailure(new RedisAskException(slot, addr)); + data.getPromise().tryFailure(new RedisAskException(slot, addr)); } else if (error.startsWith("LOADING")) { - data.getPromise().setFailure(new RedisLoadingException(error + data.getPromise().tryFailure(new RedisLoadingException(error + ". channel: " + channel + " data: " + data)); } else { - data.getPromise().setFailure(new RedisException(error + ". channel: " + channel + " command: " + data)); + data.getPromise().tryFailure(new RedisException(error + ". channel: " + channel + " command: " + data)); } } else if (code == ':') { String status = in.readBytes(in.bytesBefore((byte) '\r')).toString(CharsetUtil.UTF_8);