mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-12 03:57:32 +00:00
fix: Workaround for logged XML format exceptions when failing to parse floats
This commit is contained in:
parent
d7e890d6c3
commit
7ece973c2f
2 changed files with 7 additions and 16 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue