linq2dynamodb
linq2dynamodb copied to clipboard
[Proxy] Throw some more informative exception when proxy error occures
Maybe check for 407 error code or something like that.
Most of proxies will return their own custom error page in this case, maybe handling XmlException will suit here.
Example exception that happened because of proxy: System.Xml.XmlException : The 'BR' start tag on line 6 position 30 does not match the end tag of 'FONT'. Line 7, position 3. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args) at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag) at System.Xml.XmlTextReaderImpl.ParseEndElement() at System.Xml.XmlTextReaderImpl.ParseElementContent() at System.Xml.XmlTextReaderImpl.Read() at System.Xml.XmlTextReader.Read() at Amazon.Runtime.Internal.Transform.XmlUnmarshallerContext.ReadElement() at Amazon.Runtime.Internal.Transform.XmlUnmarshallerContext.Read() at Amazon.Runtime.Internal.Transform.ErrorResponseUnmarshaller.Unmarshall(XmlUnmarshallerContext context) at Amazon.Runtime.Internal.Transform.JsonErrorResponseUnmarshaller.Unmarshall(JsonUnmarshallerContext context) at Amazon.DynamoDBv2.Model.Internal.MarshallTransformations.DescribeTableResponseUnmarshaller.UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) at Amazon.Runtime.Internal.Transform.JsonResponseUnmarshaller.UnmarshallException(UnmarshallerContext input, Exception innerException, HttpStatusCode statusCode) at Amazon.Runtime.AmazonWebServiceClient.handleHttpWebErrorResponse(AsyncResult asyncResult, WebException we) at Amazon.Runtime.AmazonWebServiceClient.getRequestStreamCallback(IAsyncResult result) at Amazon.Runtime.AmazonWebServiceClient.endOperation(IAsyncResult result) at Amazon.DynamoDBv2.AmazonDynamoDBClient.EndDescribeTable(IAsyncResult asyncResult) at Amazon.DynamoDBv2.AmazonDynamoDBClient.DescribeTable(DescribeTableRequest describeTableRequest) at Amazon.DynamoDBv2.DocumentModel.Table.GetTableInfo() at Amazon.DynamoDBv2.DocumentModel.Table.LoadTable(AmazonDynamoDB ddbClient, String tableName, DynamoDBConsumer consumer) at Amazon.DynamoDBv2.DocumentModel.Table.LoadTable(AmazonDynamoDB ddbClient, String tableName) at Linq2DynamoDb.DataContext.DataContext.GetTableDefinition(Type entityType) in DataContext.cs: line 182 at Linq2DynamoDb.DataContext.DataContext.GetTable(Object hashKeyValue, ITableCache cacheImplementation) in DataContext.cs: line 95 at Linq2DynamoDb.DataContext.DataContext.GetTable() in DataContext.cs: line 66 at Linq2DynamoDb.DataContext.Tests.BasicQueryTests.DataContext_Query_ReturnsValidDataFromDynamoDb() in BasicQueryTests.cs: line 18