File tree 1 file changed +11
-3
lines changed
IPR.Hardware.Tools/Hardware/Controller/Dell
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -24,14 +24,16 @@ internal sealed class Dell : Hardware
24
24
private readonly List < Sensor > _fanSensors = new ( ) ;
25
25
private readonly List < Control > _fanControls = new ( ) ;
26
26
private DellSmbiosBzh _dellSmb ;
27
+ private bool _isInitialized ;
28
+ private Exception _failure ;
27
29
28
30
public Dell ( string boardName ) : base ( nameof ( Dell ) , new Identifier ( nameof ( Dell ) , boardName ) )
29
31
{
30
32
try
31
33
{
32
34
_dellSmb = new ( ) ;
33
- var initialized = _dellSmb . Initialize ( ) ;
34
- if ( ! initialized )
35
+ _isInitialized = _dellSmb . Initialize ( ) ;
36
+ if ( ! _isInitialized )
35
37
return ;
36
38
37
39
foreach ( var fan in Enum . GetValues ( typeof ( BzhFanIndex ) ) . Cast < BzhFanIndex > ( ) . Select ( ( x , i ) => new { x , i } ) )
@@ -67,7 +69,7 @@ internal sealed class Dell : Hardware
67
69
}
68
70
catch ( Exception ex )
69
71
{
70
-
72
+ _failure = ex ;
71
73
}
72
74
}
73
75
@@ -82,6 +84,12 @@ public override string GetReport()
82
84
r . AppendLine ( "Dell" ) ;
83
85
r . AppendLine ( ) ;
84
86
87
+ if ( ! _isInitialized )
88
+ {
89
+ r . AppendLine ( "Failed to initialize Dell controller." ) ;
90
+ r . AppendLine ( _failure . Message ) ;
91
+ }
92
+
85
93
r . AppendLine ( ) ;
86
94
return r . ToString ( ) ;
87
95
}
You can’t perform that action at this time.
0 commit comments