Better Error Messages for failing devices
This commit is contained in:
parent
6648d318ca
commit
83cd63d390
|
@ -18,11 +18,13 @@ public class Battery48TlDevices
|
|||
|
||||
return new Battery48TlRecords(records);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
//Console.WriteLine(e);
|
||||
// TODO: log
|
||||
|
||||
"Failed to read Battery data".WriteLine();
|
||||
|
||||
return Battery48TlRecords.Null;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using InnovEnergy.Lib.Protocols.Modbus.Channels;
|
||||
using InnovEnergy.Lib.Protocols.Modbus.Clients;
|
||||
using InnovEnergy.Lib.Protocols.Modbus.Slaves;
|
||||
using InnovEnergy.Lib.Utils;
|
||||
|
||||
namespace InnovEnergy.Lib.Devices.EmuMeter;
|
||||
|
||||
|
@ -25,10 +26,9 @@ public class EmuMeterDevice: ModbusDevice<EmuMeterRegisters>
|
|||
{
|
||||
return base.Read();
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
// TODO: Log
|
||||
Console.WriteLine(e);
|
||||
"Failed to read data from Inverters".WriteLine();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,9 +58,9 @@ public class TruConvertDcDcDevices
|
|||
|
||||
return new DcDcDevicesRecord(scStatus, dcDcRecords);
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
Console.WriteLine(e);
|
||||
"Failed to read DCDC data".WriteLine();
|
||||
return new DcDcDevicesRecord(scStatus, Array.Empty<DcDcRecord>());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue