File tree Expand file tree Collapse file tree 1 file changed +5
-10
lines changed
src/Resources/ResourceManager/Implementation/CmdletBase Expand file tree Collapse file tree 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -423,8 +423,7 @@ private void HandleException(ExceptionDispatchInfo capturedException)
423
423
var errorResponseException = capturedException . SourceException as ErrorResponseMessageException ;
424
424
if ( errorResponseException != null )
425
425
{
426
- this . WriteError ( errorResponseException . ToErrorRecord ( ) ) ;
427
- return ;
426
+ throw errorResponseException ;
428
427
}
429
428
430
429
var aggregateException = capturedException . SourceException as AggregateException ;
@@ -436,22 +435,18 @@ private void HandleException(ExceptionDispatchInfo capturedException)
436
435
errorResponseException = aggregateException . InnerExceptions . Single ( ) as ErrorResponseMessageException ;
437
436
if ( errorResponseException != null )
438
437
{
439
- this . WriteError ( errorResponseException . ToErrorRecord ( ) ) ;
440
- return ;
438
+ throw errorResponseException ;
441
439
}
442
440
443
- this . WriteError ( aggregateException . InnerExceptions . Single ( ) . ToErrorRecord ( ) ) ;
444
- return ;
441
+ throw aggregateException . InnerExceptions . Single ( ) ;
445
442
}
446
443
else
447
444
{
448
- this . WriteError ( aggregateException . ToErrorRecord ( ) ) ;
449
- return ;
445
+ throw aggregateException ;
450
446
}
451
447
}
452
448
453
- this . WriteError ( capturedException . SourceException . ToErrorRecord ( ) ) ;
454
- return ;
449
+ throw capturedException . SourceException ;
455
450
}
456
451
finally
457
452
{
You can’t perform that action at this time.
0 commit comments