CORE-4478: Caught JSON parsing errors and return a map with an error
code.