-
Notifications
You must be signed in to change notification settings - Fork 7.9k
better json error message #14672
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
base: master
Are you sure you want to change the base?
better json error message #14672
Changes from all commits
be91021
c8590bf
60aa905
1967215
376c654
9125d92
5e7de7b
79aa999
e832ae1
14b18f6
929baa3
a79a7f3
66423ec
02378dc
5848b08
e198cea
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,5 +16,5 @@ NULL | |
bool(true) | ||
NULL | ||
bool(true) | ||
string(36) "The decoded property name is invalid" | ||
string(71) "The decoded property name is invalid, at character 23 near content: 1}]" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is exactly what I was talking about when I mentioned that the might not be exactly right. This is not where ther error is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are likely many more examples where this would fail. |
||
Done |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,20 +19,20 @@ json_validate_trycatchdump("\"\x61\xf0\x80\x80\x41\"", 512, JSON_INVALID_UTF8_IG | |
json_validate_trycatchdump("[\"\xc1\xc1\",\"a\"]", 512, JSON_INVALID_UTF8_IGNORE); | ||
|
||
?> | ||
--EXPECT-- | ||
--EXPECTF-- | ||
Testing Invalid UTF-8 | ||
bool(false) | ||
int(5) | ||
string(56) "Malformed UTF-8 characters, possibly incorrectly encoded" | ||
string(92) "Malformed UTF-8 characters, possibly incorrectly encoded, at character 0 near content: %s" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should check for the exact error message (i.e. the |
||
bool(false) | ||
int(5) | ||
string(56) "Malformed UTF-8 characters, possibly incorrectly encoded" | ||
string(93) "Malformed UTF-8 characters, possibly incorrectly encoded, at character 0 near content: %s" | ||
bool(false) | ||
int(5) | ||
string(56) "Malformed UTF-8 characters, possibly incorrectly encoded" | ||
string(94) "Malformed UTF-8 characters, possibly incorrectly encoded, at character 0 near content: %s" | ||
bool(false) | ||
int(5) | ||
string(56) "Malformed UTF-8 characters, possibly incorrectly encoded" | ||
string(96) "Malformed UTF-8 characters, possibly incorrectly encoded, at character 1 near content: %s" | ||
bool(true) | ||
int(0) | ||
string(8) "No error" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to print something in the function called to update data? This might very well be justified, I just don't understand it for now, and so I wanted to ask.