Skip to content

Commit 84992ed

Browse files
authored
Merge pull request #8399 from maddieclayton/erroraction
Fix ErrorAction issue
2 parents 4833c15 + 52462cf commit 84992ed

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/Resources/ResourceManager/Implementation/CmdletBase/ResourceManagerCmdletBase.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ private void HandleException(ExceptionDispatchInfo capturedException)
423423
var errorResponseException = capturedException.SourceException as ErrorResponseMessageException;
424424
if (errorResponseException != null)
425425
{
426-
this.ThrowTerminatingError(errorResponseException.ToErrorRecord());
426+
throw errorResponseException;
427427
}
428428

429429
var aggregateException = capturedException.SourceException as AggregateException;
@@ -435,18 +435,18 @@ private void HandleException(ExceptionDispatchInfo capturedException)
435435
errorResponseException = aggregateException.InnerExceptions.Single() as ErrorResponseMessageException;
436436
if (errorResponseException != null)
437437
{
438-
this.ThrowTerminatingError(errorResponseException.ToErrorRecord());
438+
throw errorResponseException;
439439
}
440440

441-
this.ThrowTerminatingError(aggregateException.InnerExceptions.Single().ToErrorRecord());
441+
throw aggregateException.InnerExceptions.Single();
442442
}
443443
else
444444
{
445-
this.ThrowTerminatingError(aggregateException.ToErrorRecord());
445+
throw aggregateException;
446446
}
447447
}
448448

449-
capturedException.Throw();
449+
throw capturedException.SourceException;
450450
}
451451
finally
452452
{

src/Resources/Resources/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Fix for issue https://github.com/Azure/azure-powershell/issues/8235
2122

2223
## Version 1.1.1
2324
* Fix incorrect examples in `New-AzADAppCredential` and `New-AzADSpCredential` reference documentation

0 commit comments

Comments
 (0)