Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[JsonResponse] Silent only JSON errors#11418

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed

Conversation

@GromNaN
Copy link
Member

QA
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?maybe
Fixed tickets#11415
LicenseMIT
Doc PRn/a

Copy link
Member

Choose a reason for hiding this comment

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

are you sure this will cover the case properly ? If the error happens early in the error handling, thejson_last_error might be related to a previous json operation.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Sure, that's the tricky part.

I can runjson_encode(null) before to clearjson_last_error().
But it's still possible to executejson_encode orjson_decode inside aJsonSerializable object.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

The most reliable way to know if the error has been triggered by this call tojson_encode is to check the$errfile and$errline.

@fabpot
Copy link
Member

@GromNaN What's the status of this PR? Is it ready to be merged?

@GromNaN
Copy link
MemberAuthor

That's very hard to test and to catch all cases.
I've rebased the branch, but I'm not sure if it fixes the issue perfectly.

@fabpot
Copy link
Member

@GromNaN Thanks for your feedback. As your PR is an improvement over the current situation, I think it's safe to merge it as is. Perfection can be achieved later on... is possible at all.

👍

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

The warning is converted to an exception by PHPUnit.

@fabpot
Copy link
Member

Thank you@GromNaN.

fabpot added a commit that referenced this pull requestSep 22, 2014
This PR was submitted for the master branch but it was merged into the 2.5 branch instead (closes#11418).Discussion----------[JsonResponse] Silent only JSON errors| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | maybe| Fixed tickets |#11415| License       | MIT| Doc PR        | n/aCommits-------6d6a3af Clear json_last_erroref91f71 Fix JsonSerializable namespaced952f90 Catch exceptions to restore the error handlerddf95c7 [HttpFoundation] Silent only JSON errors
@fabpotfabpot closed thisSep 22, 2014
@nicolas-grekasnicolas-grekas mentioned this pull requestJul 1, 2015
3 tasks
fabpot added a commit that referenced this pull requestJul 1, 2015
This PR was merged into the 2.6 branch.Discussion----------[2.6] Towards 100% HHVM compat| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#9917,#11418| License       | MIT| Doc PR        | -Failing components:- [x] HttpFoundation- [x] HttpKernel- [x] VarDumperRelated HHVM issues:-facebook/hhvm#5563Commits-------8a78255 [2.6] Towards 100% HHVM compat
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@GromNaN@fabpot@stof

[8]ページ先頭

©2009-2025 Movatter.jp