Skip to content

Commit 52462cf

Browse files
author
maddieclayton
committed
address comments
1 parent d15f968 commit 52462cf

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

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

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

430429
var aggregateException = capturedException.SourceException as AggregateException;
@@ -436,22 +435,18 @@ private void HandleException(ExceptionDispatchInfo capturedException)
436435
errorResponseException = aggregateException.InnerExceptions.Single() as ErrorResponseMessageException;
437436
if (errorResponseException != null)
438437
{
439-
this.WriteError(errorResponseException.ToErrorRecord());
440-
return;
438+
throw errorResponseException;
441439
}
442440

443-
this.WriteError(aggregateException.InnerExceptions.Single().ToErrorRecord());
444-
return;
441+
throw aggregateException.InnerExceptions.Single();
445442
}
446443
else
447444
{
448-
this.WriteError(aggregateException.ToErrorRecord());
449-
return;
445+
throw aggregateException;
450446
}
451447
}
452448

453-
this.WriteError(capturedException.SourceException.ToErrorRecord());
454-
return;
449+
throw capturedException.SourceException;
455450
}
456451
finally
457452
{

0 commit comments

Comments
 (0)