Skip to content

Commit 290228b

Browse files
committed
moving exception messages to resource file
1 parent 7c4f9a0 commit 290228b

12 files changed

+48
-83
lines changed

src/ServiceManagement/StorSimple/Commands.StorSimple/Cmdlets/GetAzureStorSimpleResourceContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public override void ExecuteCmdlet()
4444
}
4545

4646
this.WriteObject(currentContext);
47-
this.WriteVerbose(string.Format(Resources.ResourceContextFound,currentContext.ResourceName, currentContext.ResourceName));
47+
this.WriteVerbose(string.Format(Resources.ResourceContextFound,currentContext.ResourceName, currentContext.ResourceId));
4848
}
4949

5050
catch(Exception exception)

src/ServiceManagement/StorSimple/Commands.StorSimple/Commands.StorSimple.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
<Compile Include="Cmdlets\GetAzureStorSimpleDeviceConnectedInitiator.cs" />
126126
<Compile Include="Cmdlets\GetAzureStorSimpleResource.cs" />
127127
<Compile Include="Cmdlets\GetAzureStorSimpleResourceContext.cs" />
128-
<Compile Include="Cmdlets\Job\GetAzureStorSimpleTask.cs" />
128+
<Compile Include="Cmdlets\Task\GetAzureStorSimpleTask.cs" />
129129
<Compile Include="Cmdlets\ServiceConfig\GetAzureStorSimpleStorageAccountCredential.cs" />
130130
<Compile Include="Cmdlets\ServiceConfig\NewAzureStorSimpleAccessControlRecord.cs" />
131131
<Compile Include="Cmdlets\SelectAzureStorSimpleResource.cs" />
@@ -145,8 +145,6 @@
145145
<Compile Include="Exceptions\DeviceNotYetConfiguredException.cs" />
146146
<Compile Include="Exceptions\NoDeviceRegisteredException.cs" />
147147
<Compile Include="Exceptions\RegistrationKeyException.cs" />
148-
<Compile Include="Exceptions\StorSimpleDeviceNotFoundException.cs" />
149-
<Compile Include="Exceptions\StorSimpleTaskNotFoundException.cs" />
150148
<Compile Include="Exceptions\StorSimpleSecretManagementException.cs" />
151149
<Compile Include="Exceptions\ResourceContextNotFoundException.cs" />
152150
<Compile Include="Exceptions\ResourceNotFoundException.cs" />

src/ServiceManagement/StorSimple/Commands.StorSimple/Exceptions/DeviceNotYetConfiguredException.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using System;
16+
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
1617

1718
namespace Microsoft.WindowsAzure.Commands.StorSimple.Exceptions
1819
{
1920
[Serializable]
2021
public class DeviceNotYetConfiguredException : Exception
2122
{
22-
static string genericErrorMessage = "The device name you have specified is not yet configured fully. Please complete the configuration and retry";
23+
static string genericErrorMessage = Resources.DeviceNotConfiguredMessage;
2324
/// <summary>
2425
/// Create a new instance with error message
2526
/// </summary>

src/ServiceManagement/StorSimple/Commands.StorSimple/Exceptions/NoDeviceRegisteredException.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using System;
16+
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
1617

1718
namespace Microsoft.WindowsAzure.Commands.StorSimple.Exceptions
1819
{
1920
[Serializable]
2021
public class NoDeviceRegisteredException : Exception
2122
{
22-
static string genericErrorMessage = "No StorSimple device is currently registered with this resource. Please register at least one device to the resource and rerun this command.";
23+
static string genericErrorMessage = Resources.DeviceNotRegisteredMessage;
2324
/// <summary>
2425
/// Create a new instance with error message
2526
/// </summary>

src/ServiceManagement/StorSimple/Commands.StorSimple/Exceptions/ResourceContextNotFoundException.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using System;
16+
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
1617

1718
namespace Microsoft.WindowsAzure.Commands.StorSimple.Exceptions
1819
{
1920
[Serializable]
2021
public class ResourceContextNotFoundException : Exception
2122
{
22-
static string genericErrorMessage = "Resource Context is not set for your subscription. Please use Select-AzureStorSimpleResource -ResourceName <<name>> to set";
23+
static string genericErrorMessage = Resources.ResourceContextNotSetMessage;
2324
/// <summary>
2425
/// Create a new instance with error message
2526
/// </summary>

src/ServiceManagement/StorSimple/Commands.StorSimple/Exceptions/ResourceNotFoundException.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using System;
16+
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
1617

1718
namespace Microsoft.WindowsAzure.Commands.StorSimple.Exceptions
1819
{
1920
[Serializable]
2021
public class StorSimpleResourceNotFoundException : Exception
2122
{
22-
static string genericErrorMessage = "The resourcename provided does not exist under your subscription. To get a list of all available resources use Get-AzureStorSimpleResource";
23+
static string genericErrorMessage = Resources.NotFoundMessageResource;
2324
/// <summary>
2425
/// Create a new instance with error message
2526
/// </summary>

src/ServiceManagement/StorSimple/Commands.StorSimple/Exceptions/StorSimpleDeviceNotFoundException.cs

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/ServiceManagement/StorSimple/Commands.StorSimple/Exceptions/StorSimpleTaskNotFoundException.cs

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.Designer.cs

Lines changed: 28 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ServiceManagement/StorSimple/Commands.StorSimple/Properties/Resources.resx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,4 +414,13 @@
414414
<data name="PersistSecretFailed" xml:space="preserve">
415415
<value>Could not persist secret</value>
416416
</data>
417+
<data name="DeviceNotConfiguredMessage" xml:space="preserve">
418+
<value>The device name you have specified is not yet configured fully. Please complete the configuration and retry.</value>
419+
</data>
420+
<data name="DeviceNotRegisteredMessage" xml:space="preserve">
421+
<value>No StorSimple device is currently registered with this resource. Please register at least one device to the resource and rerun this command.</value>
422+
</data>
423+
<data name="ResourceContextNotSetMessage" xml:space="preserve">
424+
<value>Resource Context is not set for your subscription. Please use Select-AzureStorSimpleResource -ResourceName &lt;&lt;name&gt;&gt; to set the resource context.</value>
425+
</data>
417426
</root>

src/ServiceManagement/StorSimple/Commands.StorSimple/ServiceClients/StorSimpleContextClient.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using System.Collections.Generic;
1818
using Microsoft.WindowsAzure.Commands.StorSimple.Encryption;
1919
using Microsoft.WindowsAzure.Commands.StorSimple.Exceptions;
20+
using Microsoft.WindowsAzure.Commands.StorSimple.Properties;
2021
using Microsoft.WindowsAzure.Management.Scheduler;
2122

2223
namespace Microsoft.WindowsAzure.Commands.StorSimple

0 commit comments

Comments
 (0)