audioslides / audioslides.io

Use Amazon Polly, Google Slides and FFMpeg to create videos that can be updated at anytime by anyone. This project is written in Elixir.
https://audioslides.io/
MIT License
27 stars 3 forks source link

feat(aws/polly): handle amazon errors #1

Open robinboehm opened 6 years ago

robinboehm commented 6 years ago
(CaseClauseError) no case clause matching: 
{:ok, %HTTPoison.Response{body: "{\"message\":\"The security token included in the request is invalid.\"}", headers: [{"x-amzn-RequestId", "7b046fac-cd2d-11e7-b2af-914568816213"}, {"x-amzn-ErrorType", "UnrecognizedClientException:http://internal.amazon.com/coral/com.amazon.coral.service/"}, ...
...
...
}
    (platform) lib/platform/speech/aws/polly.ex:137: Platform.Speech.AWS.Polly.get_binary_speech/2

Response is :ok but there is an x-amzn-ErrorType in this response.

Maybe we should create two functions?

get_binary_speech/2 get_binary_speech!/2