You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that now getJsonRawBody uses the new \Phalcon\Helper\Json that makes my old code crash because it throws a json_decode exception:
json_decode error: Syntax error
In version 3.4.5 it just returned a boolean value.
The 4.0 doc says:
public function getJsonRawBody( bool $associative = bool ): \stdClass | array | bool;
Gets decoded JSON HTTP raw request body
No problem, I could just catch the exception but the question is, Should this be the new behavior?
The text was updated successfully, but these errors were encountered:
chelipf
changed the title
getJsonRawBody on request throws an exception instead of bool value as in 3.4
getJsonRawBody throws an exception instead of bool value as in 3.4
Jan 23, 2020
chelipf
changed the title
getJsonRawBody throws an exception instead of bool value as in 3.4
getJsonRawBody throws an exception instead of a boolean value as in 3.4
Jan 23, 2020
Yes, that was one of changes in 4.0 as I checked in code, I guess we should maybe update return values because it's much better to just return exception.
It seems that now getJsonRawBody uses the new \Phalcon\Helper\Json that makes my old code crash because it throws a json_decode exception:
In version 3.4.5 it just returned a boolean value.
The 4.0 doc says:
No problem, I could just catch the exception but the question is, Should this be the new behavior?
The text was updated successfully, but these errors were encountered: