Skip to content

Commit 563407d

Browse files
author
Hovsep Mkrtchyan
committed
Moved error messages to resources.
1 parent aec5684 commit 563407d

File tree

6 files changed

+28
-4
lines changed

6 files changed

+28
-4
lines changed

src/Common/Commands.Common/Properties/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Common/Commands.Common/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,4 +1544,7 @@ Select Y to enable data collection [Y/N]:</value>
15441544
<data name="NoCurrentContextForDataCmdlet" xml:space="preserve">
15451545
<value>"There is no current context, please log in using Login-AzureRmAccount for Azure Resource Manager or Add-AzureAccount for Azure Service Management."</value>
15461546
</data>
1547+
<data name="NoSubscriptionFoundForTenant" xml:space="preserve">
1548+
<value>No subscriptions are associated with the logged in account in Azure Service Management (RDFE). This means that the logged in user is not an administrator or co-administrator for any account.\r\nDid you mean to execute Login-AzureRmAccount?</value>
1549+
</data>
15471550
</root>

src/ResourceManager/Profile/Commands.Profile/Profile/SelectAzureRMProfile.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ public override void ExecuteCmdlet()
4848
{
4949
if(!Common.Authentication.AzureSession.DataStore.FileExists(Path))
5050
{
51-
throw new PSArgumentException(string.Format("Cannot find file '{0}'", Path));
51+
throw new PSArgumentException(string.Format(
52+
Microsoft.Azure.Commands.Profile.Properties.Resources.FileNotFound,
53+
Path));
5254
}
5355

5456
AzureRmProfileProvider.Instance.Profile = new AzureRMProfile(Path);

src/ResourceManager/Profile/Commands.Profile/Properties/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ResourceManager/Profile/Commands.Profile/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@
138138
<data name="CurrentTenantInUse" xml:space="preserve">
139139
<value>Current tenant with Id '{0}' will be used.</value>
140140
</data>
141+
<data name="FileNotFound" xml:space="preserve">
142+
<value>Cannot find file '{0}'</value>
143+
</data>
141144
<data name="InvalidSubscriptionId" xml:space="preserve">
142145
<value>The provided subscription ID "{0}" is not a valid Guid.</value>
143146
</data>

src/ServiceManagement/Common/Commands.ServiceManagement.Common/ProfileClient.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,7 @@ public AzureAccount AddAccountAndLoadSubscriptions(AzureAccount account, AzureEn
325325
if (subscriptionsFromServer == null ||
326326
subscriptionsFromServer.Count ==0 )
327327
{
328-
throw new ArgumentException("No subscriptions are associated with the logged in account in " +
329-
"Azure Service Management (RDFE). This means that the logged in user is not an administrator " +
330-
"or co-administrator for any account." + Environment.NewLine + "Did you mean to execute Login-AzureRmAccount?");
328+
throw new ArgumentException(Resources.NoSubscriptionFoundForTenant);
331329
}
332330
// If account id is null the login failed
333331
if (account.Id != null)

0 commit comments

Comments
 (0)