shardingsphere
shardingsphere copied to clipboard
Redesign exception hierarchy of ShardingSphere
The current Exception is not very clear. It is better to redesign the exception hierarchy of ShardingSphere.
- The exception should split to ShardingSphereException which can throw to SDK layer for operation error by user, and ShardingSphereInsideException for internal catch;
- The ShardingSphereException should include error categories and error codes, user can query like dictionary by the error categories;
- 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;
- Re-throw other exceptions such as: IllegalArgumentException to ShardingSphereException.