setFailure replaced with tryFailure

pull/297/head
Nikita 9 years ago
parent 505e871fcc
commit 28205954de

@ -109,7 +109,7 @@ public class CommandDecoder extends ReplayingDecoder<State> {
decode(in, cmd, null, ctx.channel(), currentDecoder); decode(in, cmd, null, ctx.channel(), currentDecoder);
// } // }
} catch (IOException e) { } catch (IOException e) {
cmd.getPromise().setFailure(e); cmd.getPromise().tryFailure(e);
} }
} else if (data instanceof CommandsData) { } else if (data instanceof CommandsData) {
CommandsData commands = (CommandsData)data; CommandsData commands = (CommandsData)data;
@ -136,7 +136,7 @@ public class CommandDecoder extends ReplayingDecoder<State> {
decode(in, cmd, null, ctx.channel(), currentDecoder); decode(in, cmd, null, ctx.channel(), currentDecoder);
i++; i++;
} catch (IOException e) { } catch (IOException e) {
cmd.getPromise().setFailure(e); cmd.getPromise().tryFailure(e);
} }
} }
@ -170,17 +170,17 @@ public class CommandDecoder extends ReplayingDecoder<State> {
String[] errorParts = error.split(" "); String[] errorParts = error.split(" ");
int slot = Integer.valueOf(errorParts[1]); int slot = Integer.valueOf(errorParts[1]);
String addr = errorParts[2]; String addr = errorParts[2];
data.getPromise().setFailure(new RedisMovedException(slot, addr)); data.getPromise().tryFailure(new RedisMovedException(slot, addr));
} else if (error.startsWith("ASK")) { } else if (error.startsWith("ASK")) {
String[] errorParts = error.split(" "); String[] errorParts = error.split(" ");
int slot = Integer.valueOf(errorParts[1]); int slot = Integer.valueOf(errorParts[1]);
String addr = errorParts[2]; String addr = errorParts[2];
data.getPromise().setFailure(new RedisAskException(slot, addr)); data.getPromise().tryFailure(new RedisAskException(slot, addr));
} else if (error.startsWith("LOADING")) { } else if (error.startsWith("LOADING")) {
data.getPromise().setFailure(new RedisLoadingException(error data.getPromise().tryFailure(new RedisLoadingException(error
+ ". channel: " + channel + " data: " + data)); + ". channel: " + channel + " data: " + data));
} else { } else {
data.getPromise().setFailure(new RedisException(error + ". channel: " + channel + " command: " + data)); data.getPromise().tryFailure(new RedisException(error + ". channel: " + channel + " command: " + data));
} }
} else if (code == ':') { } else if (code == ':') {
String status = in.readBytes(in.bytesBefore((byte) '\r')).toString(CharsetUtil.UTF_8); String status = in.readBytes(in.bytesBefore((byte) '\r')).toString(CharsetUtil.UTF_8);

Loading…
Cancel
Save