amazon-archives / aws-sdk-unity

ARCHIVED: The aws sdk for unity is now distributed as a part of aws sdk for dotnet:
https://github.com/aws/aws-sdk-net
Other
105 stars 43 forks source link

DynamoDBContext ExecuteBatchWriteAsync - Does not returns unprocessed items when fails #89

Closed andreineacsu closed 8 years ago

andreineacsu commented 8 years ago

Test Scenario:

Can you please let me know how can I get the list of unprocessed items when ExecuteBatchWriteAsync fails?

Thanks, Andrei

karthiksaligrama commented 8 years ago

At the moment the sdk doesn't support retries. If it did you wouldn't be seeing this exception. There is some issues in handling retries in unity since the WWW does not give us the response body in case of an error.

So short answer No there is no way to get the the unprocessed items, I'll add it to feature requests/backlog and let you know once we have an update,

andreineacsu commented 8 years ago

I could provide you with a WWW like class that will return the response body in case of both error and success. Would this help you in improving the SDK?

karthiksaligrama commented 8 years ago

At the moment we are planning to move to UnityWebRequest API which would be available post Unity 5.3 on android and ios. That said i would love to take a look at the code and consider if your API is compatible. Do you have a github repo link? What is the license?

karthiksaligrama commented 8 years ago

Just FYI here are couple of things that i'm looking for:

  1. Wide support on multiple platforms including editors.
  2. Most of the http clients i've looked online disable SSL and ignore SSL errors. This should not be the case and you must use the default certificate store that's available on the platform.
  3. Error handling support.
andreineacsu commented 8 years ago

At the moment I can provide iOS and Android natively written plugins that would handle both SSL and HTTP errors. These plugins are written by me and does not imply a standard license.

andreineacsu commented 8 years ago

We have checked out this issue on our end and we have found that WWW returns the server's response in case of an error. Please find bellow the code we have used to read the server's response in case of a non 2xx HTTP code:

        WWW www = new WWW ("[YOUR URL]");
        yield return www;
        string response = "";
        if (www.error != null) { //contains the error message corresponding to the HTTP status code (E.g.: 500 = internal server error).
            response += www.error;
        }
        if(www.bytes != null)
        {
            response +=" Resp:" + System.Text.Encoding.UTF8.GetString(www.bytes); //contains the response received from the web server regardless if there was an error or not
        }
        resultText.text +=response;
        resultText.text +="\n";

We have tested this code on iOS 8 and 9 and the Unity Editor. I hope this helps.

karthiksaligrama commented 8 years ago

right, but the problem is also that the this feature isn't supported broadly in all the unity versions that we support. In any case looking more into retries its possible to do retries without depending on the error. I'll add a feature to retry on exceptions.Will update this thread when the feature is out.

karthiksaligrama commented 8 years ago

closed in 2.1.0.0