Azure Media Service JavaScript SDK throws exceptions?

Jigar Patel 21 Reputation points
2021-01-27T00:37:57.617+00:00

I am using the latest javascript sdk for azure media service. The method I am using is the createOrUpdate(). The documentation doens't detail any possible exceptions that would be thrown. However, I checked the .NET docs and they have exceptions. Is the javascript sdk incomplete?

Link to javascript documentation

Link to .net docs

Azure Media Services
Azure Media Services
A group of Azure services that includes encoding, format conversion, on-demand streaming, content protection, and live streaming services.
307 questions
{count} votes

Accepted answer
  1. John Deutscher (MSFT) 2,126 Reputation points
    2021-01-27T18:31:22.21+00:00

    All of the SDKs for Azure services are mostly autogenerated from the Swagger files. In the case of the .NET SDK, our team adds additional classes for exceptions.
    I checked with the SDK team for Javascript and they also confirmed the same.

    The OpenAPI (swagger file) for Media Services does not define exception types, it only defines the different status codes and error responses.
    You can see that by looking at our Open API documents for the latest version here - https://github.com/Azure/azure-rest-api-specs/tree/master/specification/mediaservices/resource-manager/Microsoft.Media/stable/2020-05-01

    In JS, it is common to not have a different error class for different scenarios. In the auto generated JS SDKs, the errors thrown by the service or any serialization errors use the RestError class.

    The SDK team for javascript could probably do a better job of documenting the usage of that though- please file an issue on them here · Azure/autorest.typescript (github.com) ?

    0 comments No comments

0 additional answers

Sort by: Most helpful