Skip to content

throw RedisException on transaction results#6

Open
asvk wants to merge 3 commits into
zhuker:masterfrom
asvk:JedisException
Open

throw RedisException on transaction results#6
asvk wants to merge 3 commits into
zhuker:masterfrom
asvk:JedisException

Conversation

@asvk
Copy link
Copy Markdown
Contributor

@asvk asvk commented Jul 12, 2017

No description provided.

Comment thread src/main/java/rtalk/RedisDao.java Outdated
}

private void checkResults(List<Object> results) {
results.stream().filter(x -> !(x instanceof String)).forEach(x -> {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exception = stream.filter.findFirst.orElse(null)
if (exception != null) 
throw exception

Comment thread src/test/java/rtalk/RTalkTest.java Outdated
}
}

@Test
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

restRedisRollback? maybe testRedisRollback

Copy link
Copy Markdown
Owner

@zhuker zhuker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments inline

@asvk
Copy link
Copy Markdown
Contributor Author

asvk commented Jul 12, 2017

@zhuker fixed

Copy link
Copy Markdown
Owner

@zhuker zhuker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

Comment thread src/test/java/rtalk/RTalkTest.java Outdated
r.zadd("data1", 0, "trash");
r.set("data1", String.valueOf(44));
});
} catch (Exception e) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use https://github.com/junit-team/junit4/wiki/exception-testing
@Test(expected = IndexOutOfBoundsException.class)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants