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

Fix the problem jsonToCacheWrapper crashes when cache value is not JSON format #1695

Merged
merged 3 commits into from
Mar 2, 2022

Conversation

guqing
Copy link
Member

@guqing guqing commented Mar 2, 2022

What this PR does?

jsonToCacheWrapper(String json)方法捕获的异常放宽为Exception,也就是一旦转换出错就不放入缓存,否则出现未处理异常时会导致功能无法使用

Why we need it?

Fix #1681, #1683
但没有完全解决 #1683 问题,所以不应该关联关闭它

@guqing guqing added the kind/bug Categorizes issue or PR as related to a bug. label Mar 2, 2022
@guqing guqing requested review from JohnNiang and ruibaby March 2, 2022 08:32
@guqing guqing self-assigned this Mar 2, 2022
@guqing guqing changed the title fix: json to cache wrapper convertor when other exception Fix json to cache wrapper converter when other exception Mar 2, 2022
@guqing guqing changed the title Fix json to cache wrapper converter when other exception Fix json to cache wrapper converter when other exception occurred Mar 2, 2022
Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

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

建议写一个相关的测试用例。

@guqing guqing requested a review from JohnNiang March 2, 2022 09:34
Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

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

LGTM

@JohnNiang JohnNiang changed the title Fix json to cache wrapper converter when other exception occurred Fix the problem jsonToCacheWrapper crashes when cache value is not JSON format Mar 2, 2022
@JohnNiang JohnNiang merged commit 52b3e4f into halo-dev:master Mar 2, 2022
@guqing guqing deleted the bugfix/1683 branch March 2, 2022 10:08
winar-jin pushed a commit to winar-jin/halo that referenced this pull request Mar 24, 2022
…ON format (halo-dev#1695)

* fix: json to cache wrapper convertor when other exception

* feat: Add test case for level cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

保存文章bug,保存分类bug
3 participants