Skip to content

Commit

Permalink
Updated the error message to include the method name and property whe…
Browse files Browse the repository at this point in the history
…n the NextLink property could not be found (Azure#1206)
  • Loading branch information
John-Hart authored and fearthecowboy committed Jun 29, 2016
1 parent 79eb329 commit 987e8db
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, object> extensions, string valueTypeName, IDictionary<int, string> typePageClasses)
private string GetPagingSetting(CompositeType body, Dictionary<string, object> extensions, string valueTypeName, IDictionary<int, string> typePageClasses, String methodName)
{
var ext = extensions[AzureExtensions.PageableExtension] as Newtonsoft.Json.Linq.JContainer;

Expand Down Expand Up @@ -118,7 +118,7 @@ private string GetPagingSetting(CompositeType body, Dictionary<string, object> 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)
{
Expand Down Expand Up @@ -184,7 +184,7 @@ private void NormalizePaginatedMethods(ServiceClient serviceClient)
{
pageClasses.Add(valueType, new Dictionary<int, string>());
}
string pagableTypeName = GetPagingSetting(compositType, method.Extensions, valueType, pageClasses[valueType]);
string pagableTypeName = GetPagingSetting(compositType, method.Extensions, valueType, pageClasses[valueType], method.SerializedName);

CompositeType pagedResult = new CompositeType
{
Expand Down

0 comments on commit 987e8db

Please sign in to comment.