Parsing json and handling error responses
<p>I'm trying to parse some json using Json.NET. The json either returns an array or an error:</p>

<pre><code>{
    "error": "Invalid category"
}
</code></pre>

<p>Or:</p>

<pre><code>[
    {
        "category_id": "23",
        "product_name": "Movie1"
    },
    {
        "category_id": "23",
        "product_name": "Movie2"
    }
]
</code></pre>

<p>How would I go about checking if an error exists and showing the message? I have tried using JObject.Parse but this throws an exception of "Current JsonReader item is not an object" which makes sense as it returns an array when there is no error.</p>
