Skip to content

Commit 59d340a

Browse files
committed
uwp: Make exceptions internal and set HRESULT
1 parent 1130e47 commit 59d340a

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

UnitsNet/AmbiguousUnitParseException.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,21 @@
2323

2424
namespace UnitsNet
2525
{
26-
public class AmbiguousUnitParseException : UnitsNetException
26+
#if WINDOWS_UWP
27+
internal
28+
#else
29+
public
30+
#endif
31+
class AmbiguousUnitParseException : UnitsNetException
2732
{
2833
public AmbiguousUnitParseException(string message) : base(message)
2934
{
35+
HResult = 2;
3036
}
3137

3238
public AmbiguousUnitParseException(string message, Exception innerException) : base(message, innerException)
3339
{
40+
HResult = 2;
3441
}
3542
}
3643
}

UnitsNet/UnitsNetException.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,26 @@
2323

2424
namespace UnitsNet
2525
{
26-
public class UnitsNetException : Exception
26+
#if WINDOWS_UWP
27+
internal
28+
#else
29+
public
30+
#endif
31+
class UnitsNetException : Exception
2732
{
2833
public UnitsNetException()
2934
{
35+
HResult = 1;
3036
}
3137

3238
public UnitsNetException(string message) : base(message)
3339
{
40+
HResult = 1;
3441
}
3542

3643
public UnitsNetException(string message, Exception innerException) : base(message, innerException)
3744
{
45+
HResult = 1;
3846
}
3947
}
4048
}

0 commit comments

Comments
 (0)