Don't fail silently on invalid json

Without this change, when the input is invalid json, it's entirely ignored, without any warning to the user.