Catch json exceptions in collector and return error message.