Skip to content

Conversation

@sazzad16
Copy link
Contributor

@sazzad16 sazzad16 commented Jan 9, 2018

  • Pipeline and Transaction related exceptions, which do not come from Redis, are changed to throw JedisBatchOperationException.
  • SafeEncoder is changed to throw JedisException.

Inspired by #1183 (comment) by @marcosnils and #1183 (comment) by @HeartSaVioR

@sazzad16 sazzad16 modified the milestones: 2.10.0, 3.0.0 Jan 9, 2018
@sazzad16
Copy link
Contributor Author

@HeartSaVioR @marcosnils ?

- Pipeline and Transaction related exceptions, which do not come from Redis, are changed to throw JedisBatchOperationException.
- SafeEncoder is changed to throw JedisException.

Based on discussions in redis#1183
@sazzad16 sazzad16 force-pushed the confusing-JedisDataException branch from 7971f00 to 21125f0 Compare November 20, 2018 18:54
@sazzad16
Copy link
Contributor Author

@marcosnils @gkorland Please review this before releasing 3.0.0. This PR will remove wrongful usages of JedisDataException.

@gkorland gkorland modified the milestones: 3.0.0, 3.1.0 Dec 6, 2018
@@ -0,0 +1,10 @@
package redis.clients.jedis.exceptions;

public class JedisBatchOperationException extends JedisException {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you make it extend "JedisDataException" this way it won't make a backward issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gkorland It was done deliberately.

According to marcosnils @marcosnils

I thought about this and I believe the best approach would be to change the type of the exception to JedisException instead of JedisDataException and to improve the logging message. ... Currently JedisDataException is used mainly when Redis returns an error about the operation. The pipeline/transaction validation we're doing it's something from the Jedis side, so it doesn't make sense to return this type of exception. ...

According to HeartSaVioR @HeartSaVioR

... I also think we shouldn't use JedisDataException which is not ERR from Redis side. ...

I agree with both of them. And that's why I crafted this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gkorland Please check #2360

Copy link
Contributor

Choose a reason for hiding this comment

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

i agree @gkorland advice, we should be compatible with JedisDataException, because maybe user code has catch JedisDataException.

So, the inheritance path is : JedisBatchOperationException extends JedisDataException extends JedisException.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yangbodong22011 WDYT about #2360 ?

@gkorland gkorland requested a review from marcosnils December 6, 2018 12:01
@sazzad16 sazzad16 modified the milestones: 3.1.0, 4.0.0 Mar 27, 2019
@sazzad16 sazzad16 requested a review from gkorland March 14, 2020 08:20
@sazzad16 sazzad16 removed this from the 4.0.0 milestone Apr 6, 2021
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.

3 participants