Skip to content

Commit

Permalink
Merge pull request #39 from AzCiS/sanmah
Browse files Browse the repository at this point in the history
Handling 404 error in powershell
  • Loading branch information
parvezah committed Apr 9, 2015
2 parents 176f2ee + 3ebf275 commit 03e323a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,9 @@ a special character</value>
<data name="SetAzureStorSimpleDeviceNoSettingsProvided" xml:space="preserve">
<value>No settings were provided for updating device details.</value>
</data>
<data name="NotFoundWebExceptionMessage" xml:space="preserve">
<value>One or more inputs passed is wrong or the cmdlet that you are trying to use is not available.</value>
</data>
<data name="EncryptionKeyNotAcceptableMessage" xml:space="preserve">
<value>Please provide an encryption key consisting of printable ASCII characters</value>
</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,19 @@ internal virtual void HandleException(Exception exception)
var response = cloudEx.Response;
try
{
XDocument xDoc = XDocument.Parse(response.Content);
StripNamespaces(xDoc);
string cloudErrorCode = xDoc.Descendants("ErrorCode").FirstOrDefault().Value;
WriteVerbose(string.Format(Resources.CloudExceptionMessage, cloudErrorCode));
if (response.StatusCode == HttpStatusCode.NotFound)
{
var notAvailableException = new Exception(Resources.NotFoundWebExceptionMessage);
errorRecord = new ErrorRecord(notAvailableException, string.Empty, ErrorCategory.InvalidOperation, null);
break;
}
else
{
XDocument xDoc = XDocument.Parse(response.Content);
StripNamespaces(xDoc);
string cloudErrorCode = xDoc.Descendants("ErrorCode").FirstOrDefault().Value;
WriteVerbose(string.Format(Resources.CloudExceptionMessage, cloudErrorCode));
}
}
catch (Exception)
{
Expand Down Expand Up @@ -380,7 +389,7 @@ public bool IsDeviceConfigurationCompleteForDevice(DeviceDetails details)
}
return data0Configured;
}
/// <summary>
/// this method verifies that the devicename parameter specified is completely configured
/// most operations are not allowed on a non-configured device
Expand Down

0 comments on commit 03e323a

Please sign in to comment.