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

Backport(v1.16): parser_json: fix wrong LoadError warning (#4522) #4592

Merged
merged 1 commit into from
Aug 16, 2024

Conversation

daipom
Copy link
Contributor

@daipom daipom commented Aug 15, 2024

Backported from 891ce71. (#4522)

Backported from 891ce71.

---

If Oj is not installed, LoadError with the empty message is raised.
So, the current condition `/\boj\z/.match?(ex.message)` does not work
and the following meaningless warning is displayed.

    {datetime} [warn]: #x {id} LoadError

After this fix, the log message will be:

    {datetime} [info]: #x {id} Oj is not installed, and failing back to
    Yajl for json parser

Refactor "rescue" logic because this falling back feature is
currently only for "oj" (LoadError can not occur for "json" and
"yajl").

Signed-off-by: Daijiro Fukuda <[email protected]>
Co-authored-by: Takuro Ashie <[email protected]>
@daipom daipom added this to the v1.16.6 milestone Aug 15, 2024
@daipom daipom merged commit 2824884 into v1.16 Aug 16, 2024
16 checks passed
@daipom daipom deleted the v1.16-backport-4522 branch August 16, 2024 05:57
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.

2 participants