This project is read-only.

Querying for Items that may or may not exist

Sep 17, 2013 at 10:57 AM
I'm trying to grab a bunch of item data from the Armory, but I've run into a bit of a snag. If I query for an item ID that currently doesn't exist I get the same exception as if my request was completely invalid.

This url: http://us.battle.net/api/wow/item/5
Yields this data: "{"status":"nok", "reason": "unable to get item information."}"
But it also returns a 404 error.

Is there anyway to tell if the call fails because of a "real" error vs an item that doesn't exist?
Sep 21, 2013 at 12:11 AM
Hi

Sorry for the late reply.

The Wowsharp throws an exception of type ApiException. For which you can check the InnerException. If the InnerException is also an ApiException, you can check the HTTPStatusCode property.

Best regards,
Sherif aka Grendizer