diff options
author | Andrew Dolgov <[email protected]> | 2018-12-24 12:28:11 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-12-24 12:28:11 +0300 |
commit | 215c9f0f885f6c761349c363e16a9f9c2d7abde4 (patch) | |
tree | 92086355db36795c18fdff70e99a3800fa5ff748 /classes/feeds.php | |
parent | eedd402807aef9a26b47acb4126453c32ff46163 (diff) |
fail better if Feeds.view() data failed encoding to JSON
Diffstat (limited to 'classes/feeds.php')
-rwxr-xr-x | classes/feeds.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/classes/feeds.php b/classes/feeds.php index 38819ec77..489ffd3c4 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -563,7 +563,14 @@ class Feeds extends Handler_Protected { // this is parsed by handleRpcJson() on first viewfeed() to set cdm expanded, etc $reply['runtime-info'] = make_runtime_info(); - print json_encode($reply); + $reply_json = json_encode($reply); + + if (!$reply_json) { + $reply_json = json_encode(["error" => ["code" => 15, + "message" => json_last_error_msg()]]); + } + + print $reply_json; } |