Skip to content

Commit 41a9dec

Browse files
committed
Fix localization issue when choosing existing standard stroage account
1 parent 0cc8a43 commit 41a9dec

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

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

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

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,4 +507,8 @@ The file needs to be a PowerShell script (.ps1 or .psm1) or a ZIP archive (.zip)
507507
<data name="DisableAzureDiskEncryptionConfirmation" xml:space="preserve">
508508
<value>This cmdlet disables encryption on the VM which may reboot the machine. Please save your work on the VM before confirming. Do you want to continue?</value>
509509
</data>
510+
<data name="ErrorDuringChoosingStandardStorageAccount" xml:space="preserve">
511+
<value>Error occurred when choosing existing standard storage account for boot diagnostics: {0}</value>
512+
<comment>{0} = an error message</comment>
513+
</data>
510514
</root>

src/ResourceManager/Compute/Commands.Compute/VirtualMachine/Operation/NewAzureVMCommand.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,6 @@ private Uri GetOrCreateStorageAccountForBootDiagnostics()
244244
}
245245
catch (Exception e)
246246
{
247-
if (e.Message.Contains("Unable to find a matching HTTP request"))
248-
{
249-
throw;
250-
}
251-
252247
if (e.Message.Contains("ResourceNotFound"))
253248
{
254249
WriteWarning(string.Format(
@@ -303,11 +298,9 @@ private StorageAccount TryToChooseExistingStandardStorageAccount(StorageManageme
303298
}
304299
catch (InvalidOperationException e)
305300
{
306-
if (e.Message.Contains("Sequence contains no matching element"))
307-
{
308-
return null;
309-
}
310-
throw;
301+
WriteWarning(string.Format(
302+
Properties.Resources.ErrorDuringChoosingStandardStorageAccount, e.Message));
303+
return null;
311304
}
312305
}
313306

0 commit comments

Comments
 (0)