From c313bcb4dfcd974da9ba3683929923515350cda9 Mon Sep 17 00:00:00 2001 From: xingwu1 Date: Tue, 7 Jun 2016 15:59:30 -0700 Subject: [PATCH] Do not use generic Exception type. --- .../Python/Azure.Python/AzurePythonCodeGenerator.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/AutoRest/Generators/Python/Azure.Python/AzurePythonCodeGenerator.cs b/AutoRest/Generators/Python/Azure.Python/AzurePythonCodeGenerator.cs index 36b8553359..a962758da4 100644 --- a/AutoRest/Generators/Python/Azure.Python/AzurePythonCodeGenerator.cs +++ b/AutoRest/Generators/Python/Azure.Python/AzurePythonCodeGenerator.cs @@ -116,14 +116,13 @@ private string GetPagingSetting(CompositeType body, Dictionary e if (!findNextLink) { - throw new Exception("Couldn't find the nextLink property specified by extension"); + throw new KeyNotFoundException("Couldn't find the nextLink property specified by extension"); } if (!findItem) { - throw new Exception("Couldn't find the item property specified by extension"); + throw new KeyNotFoundException("Couldn't find the item property specified by extension"); } - // TODO: Need to validate the nextLinkName is in the type var pageModel = new PageTemplateModel(className, nextLinkName, itemName, valueTypeName); if (!pageModels.Contains(pageModel)) {