Archomeda/Gw2Sharp

Requesting many items with a non-existent id throws KeyNotFoundException

Closed this issue · 0 comments

For example, running the following code:

using var client = new Gw2Client();
await client.WebApi.V2.Specializations.ManyAsync(new[] { -1, 1 });

will throw a KeyNotFoundException from BaseCacheMethod.GetOrUpdateManyAsync.

The cause is that there's at least one id, but not all ids, that's not valid (a.k.a. does not exist on the API).
Gw2Sharp should do the same as the API: ignore invalid ids and return the partial list of items.