Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[问题] 删除不存在的数据会报错 #759

Open
jia199807 opened this issue Sep 14, 2024 · 2 comments
Open

[问题] 删除不存在的数据会报错 #759

jia199807 opened this issue Sep 14, 2024 · 2 comments
Labels

Comments

@jia199807
Copy link
Contributor

jia199807 commented Sep 14, 2024

Description

image
image
图一为删除不存在的数据。
图二为删除存在的数据。
我希望删除不存在的数据的返回结果,和查询不存在的数据的返回结果类似,即 ok:true,code:200,count:0,id不显示
请问应该如何修改?

@jia199807
Copy link
Contributor Author

我注意到AbstractSQLExecutor:248中的注释,修改IllegalAccessException为NotExistException可以实现上述需求吗?
这种方式会不会影响后续版本升级的兼容呢。
image

@TommyLemon
Copy link
Collaborator

TommyLemon commented Sep 18, 2024

之前是通过 throw NotExistException 到 AbstractObjectParser 忽略异常继续往后解析的,后面 CSIG 同事反馈需要抛异常给调用方自己处理,改成了现在这样。

直接改能解决这个问题,但也确实会影响兼容。
可以加个配置参数判断抛哪种异常,例如常量 IS_THROW_WHEN_DELETE_NOT_FOUND = true。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants