Skip to content

Commit 7fca2c3

Browse files
committed
Add warning messages for all exceptions.
1 parent 39fa88e commit 7fca2c3

File tree

3 files changed

+22
-4
lines changed

3 files changed

+22
-4
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: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,11 @@ The file needs to be a PowerShell script (.ps1 or .psm1) or a ZIP archive (.zip)
453453
<comment>{0} = existing standard storage account name</comment>
454454
</data>
455455
<data name="ErrorDuringGettingStorageAccountForBootDiagnostics" xml:space="preserve">
456-
<value>Error occurred when getting storage account, {0}, for boot diagnostics.</value>
456+
<value>Error occurred when getting storage account, {0}, for boot diagnostics: {1}</value>
457+
<comment>{0} = storage account name, {1} = error message</comment>
458+
</data>
459+
<data name="StorageAccountNotFoundForBootDiagnostics" xml:space="preserve">
460+
<value>Storage account, {0}, is not found. The OS disk may be in a different storage group.</value>
457461
<comment>{0} = storage account name</comment>
458462
</data>
459463
</root>

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,15 @@ private Uri GetOrCreateStorageAccountForBootDiagnostics()
111111
}
112112
catch (Exception e)
113113
{
114-
if (!e.Message.Contains("ResourceNotFound"))
114+
if (e.Message.Contains("ResourceNotFound"))
115115
{
116116
WriteWarning(string.Format(
117-
Properties.Resources.ErrorDuringGettingStorageAccountForBootDiagnostics, storageAccountName));
117+
Properties.Resources.StorageAccountNotFoundForBootDiagnostics, storageAccountName));
118+
}
119+
else
120+
{
121+
WriteWarning(string.Format(
122+
Properties.Resources.ErrorDuringGettingStorageAccountForBootDiagnostics, storageAccountName, e.Message));
118123
}
119124
}
120125
}

0 commit comments

Comments
 (0)