shardingsphere icon indicating copy to clipboard operation
shardingsphere copied to clipboard

Redesign exception hierarchy of ShardingSphere

Open terrymanu opened this issue 2 years ago • 0 comments

The current Exception is not very clear. It is better to redesign the exception hierarchy of ShardingSphere.

  1. The exception should split to ShardingSphereException which can throw to SDK layer for operation error by user, and ShardingSphereInsideException for internal catch;
  2. The ShardingSphereException should include error categories and error codes, user can query like dictionary by the error categories;
  3. ShardingSphereInsideException should catch by ShardingSphere and never throw to SDK directly, it can be thrown by error packet or re-throw by ShardingSphereException with error category and error code;
  4. Re-throw other exceptions such as: IllegalArgumentException to ShardingSphereException.

terrymanu avatar Aug 09 '22 14:08 terrymanu