Skip to content

Commit

Permalink
Improve exception handling and logging (#248)
Browse files Browse the repository at this point in the history
# Description
Summary of changes:
- Improvements to exception handling and logging

# Change type
- [ ] Bug fix (non-breaking change)
- [ ] Code style update (formatting, local variables)
- [x] New Feature (non-breaking change that adds new functionality
without impacting existing)
- [ ] Breaking change (fix or feature that may cause functionality
impact)
- [ ] Other

# Checklist:
- [x] My code follows the style and contribution guidelines of this
project.
- [x] I have tested and validated my code changes.
  • Loading branch information
arudell authored Apr 2, 2024
1 parent 573568c commit c4cfa58
Show file tree
Hide file tree
Showing 147 changed files with 455 additions and 354 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ function Export-RegistryKeyConfigDetails {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ function Get-CommonConfigState {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}

$ProgressPreference = 'Continue'
Expand Down
1 change: 1 addition & 0 deletions src/modules/SdnDiag.Common/private/Get-TraceProviders.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,6 @@ function Get-TraceProviders {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@ function Start-EtwTraceSession {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
1 change: 1 addition & 0 deletions src/modules/SdnDiag.Common/private/Start-NetshTrace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,6 @@ function Start-NetshTrace {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ function Stop-EtwTraceSession {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
1 change: 1 addition & 0 deletions src/modules/SdnDiag.Common/private/Stop-NetshTrace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ function Stop-NetshTrace {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,6 @@ function Convert-SdnEtwTraceToTxt {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
1 change: 1 addition & 0 deletions src/modules/SdnDiag.Common/public/Enable-SdnVipTrace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,6 @@ function Enable-SdnVipTrace {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
1 change: 1 addition & 0 deletions src/modules/SdnDiag.Common/public/Get-SdnCertificate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@ function Get-SdnCertificate {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
1 change: 1 addition & 0 deletions src/modules/SdnDiag.Common/public/Get-SdnEventLog.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@ function Get-SdnEventLog {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
1 change: 1 addition & 0 deletions src/modules/SdnDiag.Common/public/Invoke-SdnGetNetView.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@ function Invoke-SdnGetNetView {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
1 change: 1 addition & 0 deletions src/modules/SdnDiag.Common/public/New-SdnCertificate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@ function New-SdnCertificate {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ function Repair-SdnDiagnosticsScheduledTask {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,6 @@ function Set-SdnCertificateAcl {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ function Start-SdnEtwTraceCapture {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
1 change: 1 addition & 0 deletions src/modules/SdnDiag.Common/public/Start-SdnNetshTrace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,6 @@ function Start-SdnNetshTrace {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ function Stop-SdnEtwTraceCapture {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
1 change: 1 addition & 0 deletions src/modules/SdnDiag.Common/public/Stop-SdnNetshTrace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ function Stop-SdnNetshTrace {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ function Get-GatewayConfigState {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}

$ProgressPreference = 'Continue'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ function Disable-SdnRasGatewayTracing {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@ function Enable-SdnRasGatewayTracing {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
1 change: 1 addition & 0 deletions src/modules/SdnDiag.Health/private/Test-EncapOverhead.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,6 @@ function Test-EncapOverhead {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@ function Test-HostRootStoreNonRootCert {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,6 @@ function Test-MuxBgpConnectionState {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,6 @@ function Test-NcHostAgentConnectionToApiService {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,6 @@ function Test-NcUrlNameResolution {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,6 @@ function Test-NetworkControllerCertCredential {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@ function Test-NetworkInterfaceAPIDuplicateMacAddress {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,6 @@ function Test-ProviderNetwork {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,6 @@ function Test-ResourceConfigurationState {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,6 @@ function Test-ResourceProvisioningState {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,6 @@ function Test-ScheduledTaskEnabled {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
1 change: 1 addition & 0 deletions src/modules/SdnDiag.Health/private/Test-ServerHostId.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@ function Test-ServerHostId {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ function Test-ServiceFabricApplicationHealth {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ function Test-ServiceFabricClusterHealth {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ function Test-ServiceFabricNodeStatus {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,6 @@ function Test-ServiceFabricPartitionDatabaseSize {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
1 change: 1 addition & 0 deletions src/modules/SdnDiag.Health/private/Test-ServiceState.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,6 @@ function Test-ServiceState {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,6 @@ function Test-SlbManagerConnectionToMux {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,6 @@ function Test-VMNetAdapterDuplicateMacAddress {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,6 @@ function Test-VfpDuplicatePort {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -226,5 +226,6 @@ function Debug-SdnFabricInfrastructure {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function Get-SlbMuxConfigState {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}

$ProgressPreference = 'Continue'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ function Get-SdnMuxCertificate {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ function Get-SdnMuxDistributedRouterIP {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ function Get-SdnMuxState {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ function Get-SdnMuxStatefulVip {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ function Get-SdnMuxStatelessVip {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ function Get-SdnMuxStats {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ function Get-SdnMuxVip {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ function Get-SdnMuxVipConfig {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,6 @@ function New-SdnMuxCertificate {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -201,5 +201,6 @@ function Start-SdnMuxCertificateRotation {
}
catch {
$_ | Trace-Exception
$_ | Write-Error
}
}
Loading

0 comments on commit c4cfa58

Please sign in to comment.