mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-01-11 19:44:55 +00:00
fix: Workaround for logged XML format exceptions when failing to parse floats
This commit is contained in:
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
||||
### Changed
|
||||
- Repeater changed to use configured callbacks instead of a dumb event
|
||||
- Scheduled action callbacks allow a TimeSpan to be returned to delay actions
|
||||
- Workaround for logged XML format exceptions when failing to parse floats
|
||||
|
||||
## [12.1.0] - 2020-07-14
|
||||
### Added
|
||||
|
||||
@@ -177,26 +177,16 @@ namespace ICD.Common.Utils.Xml
|
||||
|
||||
public long ReadElementContentAsLong()
|
||||
{
|
||||
try
|
||||
{
|
||||
return m_Reader.ReadElementContentAsLong();
|
||||
}
|
||||
catch (XmlException e)
|
||||
{
|
||||
throw new IcdXmlException(e);
|
||||
}
|
||||
// ReadElementContentAsLong() logs and throws...
|
||||
string value = ReadElementContentAsString();
|
||||
return long.Parse(value);
|
||||
}
|
||||
|
||||
public float ReadElementContentAsFloat()
|
||||
{
|
||||
try
|
||||
{
|
||||
return m_Reader.ReadElementContentAsFloat();
|
||||
}
|
||||
catch (XmlException e)
|
||||
{
|
||||
throw new IcdXmlException(e);
|
||||
}
|
||||
// ReadElementContentAsFloat() logs and throws...
|
||||
string value = ReadElementContentAsString();
|
||||
return float.Parse(value);
|
||||
}
|
||||
|
||||
public bool ReadElementContentAsBoolean()
|
||||
|
||||
Reference in New Issue
Block a user