buffet: Improve error reporting by limiting JSON string length

Log messages are limited to 2000 characters. If JSON strings are
too long and fail to be parsed, the actual parse error portion of
the log message is truncated.

Limit the length of JSON strings quoted in error logs to 1700 chars
to leave some room for other parts of the error message.

BUG=None
TEST=`FEATURES=test emerge-link buffet`

Change-Id: I72f4e2c135c74366cd84e87e1a589a6a3423c154
Reviewed-on: https://chromium-review.googlesource.com/264937
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
1 file changed
tree: cd8f73b61d33aaa44e8271647de4a13b93b527c7
  1. buffet/