From 987e8dbf58db9d00391ed9d7758383017d17fb65 Mon Sep 17 00:00:00 2001 From: John Hart Date: Wed, 29 Jun 2016 11:58:10 -0700 Subject: [PATCH] Updated the error message to include the method name and property when the NextLink property could not be found (#1206) --- .../Python/Azure.Python/AzurePythonCodeGenerator.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AutoRest/Generators/Python/Azure.Python/AzurePythonCodeGenerator.cs b/AutoRest/Generators/Python/Azure.Python/AzurePythonCodeGenerator.cs index d87b80c2fc2ae..f4922e4867faa 100644 --- a/AutoRest/Generators/Python/Azure.Python/AzurePythonCodeGenerator.cs +++ b/AutoRest/Generators/Python/Azure.Python/AzurePythonCodeGenerator.cs @@ -88,7 +88,7 @@ private static void NormalizeApiVersion(ServiceClient serviceClient) } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly", MessageId = "nextLink")] - private string GetPagingSetting(CompositeType body, Dictionary extensions, string valueTypeName, IDictionary typePageClasses) + private string GetPagingSetting(CompositeType body, Dictionary extensions, string valueTypeName, IDictionary typePageClasses, String methodName) { var ext = extensions[AzureExtensions.PageableExtension] as Newtonsoft.Json.Linq.JContainer; @@ -118,7 +118,7 @@ private string GetPagingSetting(CompositeType body, Dictionary e if (!ignoreNextLink && !findNextLink) { - throw new KeyNotFoundException("Couldn't find the nextLink property specified by extension"); + throw new KeyNotFoundException(String.Format(CultureInfo.InvariantCulture, "Couldn't find the nextLink property specified by extension on operation {0} and property {1}", methodName, body.SerializedName)); } if (!findItem) { @@ -184,7 +184,7 @@ private void NormalizePaginatedMethods(ServiceClient serviceClient) { pageClasses.Add(valueType, new Dictionary()); } - string pagableTypeName = GetPagingSetting(compositType, method.Extensions, valueType, pageClasses[valueType]); + string pagableTypeName = GetPagingSetting(compositType, method.Extensions, valueType, pageClasses[valueType], method.SerializedName); CompositeType pagedResult = new CompositeType {