From 544e4350288198e5d14db52f6df19535210ceea6 Mon Sep 17 00:00:00 2001 From: Jonathan Myers Date: Tue, 26 Jul 2016 15:01:23 -0700 Subject: [PATCH] Warn if there are problems getting location, instead of failing --- .../Strings/resources.resjson/en-US/resources.resjson | 1 + Tasks/NuGetInstaller/nugetinstaller.ts | 5 ++++- Tasks/NuGetInstaller/task.json | 3 ++- Tasks/NuGetInstaller/task.loc.json | 3 ++- .../Strings/resources.resjson/en-US/resources.resjson | 1 + Tasks/NugetPublisher/nugetpublisher.ts | 5 ++++- Tasks/NugetPublisher/task.json | 3 ++- Tasks/NugetPublisher/task.loc.json | 3 ++- 8 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Tasks/NuGetInstaller/Strings/resources.resjson/en-US/resources.resjson b/Tasks/NuGetInstaller/Strings/resources.resjson/en-US/resources.resjson index 1dad73dee7e0..3a7a554c1f45 100644 --- a/Tasks/NuGetInstaller/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/NuGetInstaller/Strings/resources.resjson/en-US/resources.resjson @@ -31,6 +31,7 @@ "loc.messages.NotARegularFile": "%s i not a solution file. Check the 'path to solution or packages.config' property of the NuGetInstaller task.", "loc.messages.UnknownRestoreMode": "Unknown restore mode '%s'", "loc.messages.CouldNotFindNuGetService": "Could not find the NuGet service. This task will be unable to authenticate to feeds hosted in your Team Services account/TFS project collection.", + "loc.messages.ErrorPreventsAuth": "An error occurred while locating the Team Services/TFS NuGet service. Will not be able to authenticate to Team Services/TFS-hosted feeds.", "loc.messages.NGCommon_IgnoringNuGetExtensionsPath": "Detected NuGet extensions loader path (NUGET_EXTENSIONS_PATH environment variable). Extensions are ignored when using the built-in NuGet client", "loc.messages.NGCommon_DetectedNuGetExtensionsPath": "Detected NuGet extensions loader path (NUGET_EXTENSIONS_PATH environment variable): %s", "loc.messages.NGCommon_UnableToFindTool": "Unable to find tool %s", diff --git a/Tasks/NuGetInstaller/nugetinstaller.ts b/Tasks/NuGetInstaller/nugetinstaller.ts index 2a9d2c0eb93a..435ee649e76d 100644 --- a/Tasks/NuGetInstaller/nugetinstaller.ts +++ b/Tasks/NuGetInstaller/nugetinstaller.ts @@ -95,7 +95,10 @@ locationHelpers.getNuGetConnectionData(serviceUri, accessToken) return []; } - throw err; + // for now, make this a warning, since we're getting customers broken trying to call location service + tl.warning(tl.loc("ErrorPreventsAuth")); + tl.warning(err); + return []; }) .then(urlPrefixes => { tl.debug("discovered URL prefixes: " + urlPrefixes.join(';')) diff --git a/Tasks/NuGetInstaller/task.json b/Tasks/NuGetInstaller/task.json index f9293962764c..4841a19456ff 100644 --- a/Tasks/NuGetInstaller/task.json +++ b/Tasks/NuGetInstaller/task.json @@ -9,7 +9,7 @@ "version": { "Major": 0, "Minor": 2, - "Patch": 0 + "Patch": 1 }, "minimumAgentVersion": "1.83.0", "groups": [ @@ -117,6 +117,7 @@ "NotARegularFile": "%s i not a solution file. Check the 'path to solution or packages.config' property of the NuGetInstaller task.", "UnknownRestoreMode": "Unknown restore mode '%s'", "CouldNotFindNuGetService": "Could not find the NuGet service. This task will be unable to authenticate to feeds hosted in your Team Services account/TFS project collection.", + "ErrorPreventsAuth": "An error occurred while locating the Team Services/TFS NuGet service. Will not be able to authenticate to Team Services/TFS-hosted feeds.", "NGCommon_IgnoringNuGetExtensionsPath": "Detected NuGet extensions loader path (NUGET_EXTENSIONS_PATH environment variable). Extensions are ignored when using the built-in NuGet client", "NGCommon_DetectedNuGetExtensionsPath": "Detected NuGet extensions loader path (NUGET_EXTENSIONS_PATH environment variable): %s", diff --git a/Tasks/NuGetInstaller/task.loc.json b/Tasks/NuGetInstaller/task.loc.json index 0a7a2eee663d..9465bc879dd6 100644 --- a/Tasks/NuGetInstaller/task.loc.json +++ b/Tasks/NuGetInstaller/task.loc.json @@ -9,7 +9,7 @@ "version": { "Major": 0, "Minor": 2, - "Patch": 0 + "Patch": 1 }, "minimumAgentVersion": "1.83.0", "groups": [ @@ -117,6 +117,7 @@ "NotARegularFile": "ms-resource:loc.messages.NotARegularFile", "UnknownRestoreMode": "ms-resource:loc.messages.UnknownRestoreMode", "CouldNotFindNuGetService": "ms-resource:loc.messages.CouldNotFindNuGetService", + "ErrorPreventsAuth": "ms-resource:loc.messages.ErrorPreventsAuth", "NGCommon_IgnoringNuGetExtensionsPath": "ms-resource:loc.messages.NGCommon_IgnoringNuGetExtensionsPath", "NGCommon_DetectedNuGetExtensionsPath": "ms-resource:loc.messages.NGCommon_DetectedNuGetExtensionsPath", "NGCommon_UnableToFindTool": "ms-resource:loc.messages.NGCommon_UnableToFindTool", diff --git a/Tasks/NugetPublisher/Strings/resources.resjson/en-US/resources.resjson b/Tasks/NugetPublisher/Strings/resources.resjson/en-US/resources.resjson index 5f363775260d..3c6847773b02 100644 --- a/Tasks/NugetPublisher/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/NugetPublisher/Strings/resources.resjson/en-US/resources.resjson @@ -30,6 +30,7 @@ "loc.messages.NotARegularFile": "%s is not a solution file. Check the 'path to solution or packages.config' property of the NuGetInstaller task.", "loc.messages.UnknownFeedType": "Unknown feed type '%s'", "loc.messages.CouldNotFindNuGetService": "Could not find the NuGet service. This task will be unable to authenticate to feeds hosted in your Team Services account/TFS project collection.", + "loc.messages.ErrorPreventsAuth": "An error occurred while locating the Team Services/TFS NuGet service. Will not be able to authenticate to Team Services/TFS-hosted feeds.", "loc.messages.NGCommon_IgnoringNuGetExtensionsPath": "Detected NuGet extensions loader path (NUGET_EXTENSIONS_PATH environment variable). Extensions are ignored when using the built-in NuGet client", "loc.messages.NGCommon_DetectedNuGetExtensionsPath": "Detected NuGet extensions loader path (NUGET_EXTENSIONS_PATH environment variable): %s", "loc.messages.NGCommon_UnableToFindTool": "Unable to find tool %s", diff --git a/Tasks/NugetPublisher/nugetpublisher.ts b/Tasks/NugetPublisher/nugetpublisher.ts index 92ae13a2a1bf..97d7de62cad5 100644 --- a/Tasks/NugetPublisher/nugetpublisher.ts +++ b/Tasks/NugetPublisher/nugetpublisher.ts @@ -92,7 +92,10 @@ locationHelpers.getNuGetConnectionData(serviceUri, accessToken) return []; } - throw err; + // for now, make this a warning, since we're getting customers broken trying to call location service + tl.warning(tl.loc("ErrorPreventsAuth")); + tl.warning(err); + return []; }) .then(urlPrefixes => { tl.debug("discovered URL prefixes: " + urlPrefixes.join(';')) diff --git a/Tasks/NugetPublisher/task.json b/Tasks/NugetPublisher/task.json index d057b27727e4..77683889d5cc 100644 --- a/Tasks/NugetPublisher/task.json +++ b/Tasks/NugetPublisher/task.json @@ -9,7 +9,7 @@ "version": { "Major": 0, "Minor": 2, - "Patch": 0 + "Patch": 1 }, "demands": [ "Cmd" @@ -122,6 +122,7 @@ "NotARegularFile": "%s is not a solution file. Check the 'path to solution or packages.config' property of the NuGetInstaller task.", "UnknownFeedType": "Unknown feed type '%s'", "CouldNotFindNuGetService": "Could not find the NuGet service. This task will be unable to authenticate to feeds hosted in your Team Services account/TFS project collection.", + "ErrorPreventsAuth": "An error occurred while locating the Team Services/TFS NuGet service. Will not be able to authenticate to Team Services/TFS-hosted feeds.", "NGCommon_IgnoringNuGetExtensionsPath": "Detected NuGet extensions loader path (NUGET_EXTENSIONS_PATH environment variable). Extensions are ignored when using the built-in NuGet client", "NGCommon_DetectedNuGetExtensionsPath": "Detected NuGet extensions loader path (NUGET_EXTENSIONS_PATH environment variable): %s", diff --git a/Tasks/NugetPublisher/task.loc.json b/Tasks/NugetPublisher/task.loc.json index e4a55e90b62c..60e288a3eee3 100644 --- a/Tasks/NugetPublisher/task.loc.json +++ b/Tasks/NugetPublisher/task.loc.json @@ -9,7 +9,7 @@ "version": { "Major": 0, "Minor": 2, - "Patch": 0 + "Patch": 1 }, "demands": [ "Cmd" @@ -121,6 +121,7 @@ "NotARegularFile": "ms-resource:loc.messages.NotARegularFile", "UnknownFeedType": "ms-resource:loc.messages.UnknownFeedType", "CouldNotFindNuGetService": "ms-resource:loc.messages.CouldNotFindNuGetService", + "ErrorPreventsAuth": "ms-resource:loc.messages.ErrorPreventsAuth", "NGCommon_IgnoringNuGetExtensionsPath": "ms-resource:loc.messages.NGCommon_IgnoringNuGetExtensionsPath", "NGCommon_DetectedNuGetExtensionsPath": "ms-resource:loc.messages.NGCommon_DetectedNuGetExtensionsPath", "NGCommon_UnableToFindTool": "ms-resource:loc.messages.NGCommon_UnableToFindTool",