microsoft / Cognitive-Vision-Windows

Windows SDK for the Microsoft Computer Vision API, part of Cognitive Services
https://www.microsoft.com/cognitive-services/en-us/computer-vision-api
Other
166 stars 150 forks source link

Generic exception thrown when keys have expired #4

Closed margaretmz closed 6 years ago

margaretmz commented 8 years ago

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

margaretmz commented 8 years ago

From @yungshinlintw on February 16, 2016 16:20

Hi SaqibS,

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

cthrash commented 6 years ago

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."