microsoft/Cognitive-Vision-Windows

Generic exception thrown when keys have expired

margaretmz opened this issue · 2 comments

From @SaqibS on December 19, 2015 16:54

I have an Azure service which makes use of multiple Project Oxford APIs, and overnight calls to each of the services started failing.

I looked through the logs, and found that the client libraries for both Vision and Face were throwing a System.Exception, with message: "Transport error".

Eventually, I found that invoking the APIs using rest directly, I got a useful message back, saying that the keys had expired. Why this happened is a separate issue, along with why I didn't get any emails to say that the keys were going to expire (they still show as active on the website). But that's all separate - this bug relates to the fact that the client libraries shouldn't just throw a generic Exception with such a vague message. The message returned by the rest API should be wrapped in the client-specific exception.

Copied from original issue: microsoft/ProjectOxford-ClientSDK#13

From @yungshinlintw on February 16, 2016 16:20

Hi SaqibS,

Thanks a lot for reporting this! We will address this for the next update.

If a key is expired, it is the APIM layer that returns the 401 error. Our service never sees the request.
We could add code in this SDK to differentiate a bad key vs expired key, but as we don't control that part of stack, it would be brittle. Resolving as "wont' fix."