Skip to content

Commit c971e46

Browse files
lipchevangularsen
andauthored
Replaced the NotImplementedException from ToUnit with UnitNotFoundException (#1594)
- moved all exceptions into a new solution folder - replaced the `NotImplementedException` which is thrown from the `ToUnit` method with `UnitNotFoundException` --------- Co-authored-by: Andreas Gullberg Larsen <andreas.larsen84@gmail.com>
1 parent 77d4aac commit c971e46

File tree

263 files changed

+391
-391
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

263 files changed

+391
-391
lines changed

CodeGen/Generators/NanoFrameworkGen/QuantityGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ private double GetValueInBaseUnit()
202202
}
203203

204204
Writer.WL($@"
205-
_ => throw new NotImplementedException($""Can not convert {{Unit}} to base units."")
205+
_ => throw new NotImplementedException($""Can't convert {{Unit}} to base units."")
206206
}};
207207
}}
208208
@@ -223,7 +223,7 @@ private double GetValueAs({_unitEnumName} unit)
223223
}
224224

225225
Writer.WL(@"
226-
_ => throw new NotImplementedException($""Can not convert {Unit} to {unit}."")
226+
_ => throw new NotImplementedException($""Can't convert {Unit} to {unit}."")
227227
};
228228
}
229229

CodeGen/Generators/UnitsNetGen/QuantityGenerator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ namespace UnitsNet
100100
}}");
101101
return Writer.ToString();
102102
}
103-
103+
104104
private void GenerateInterfaceExtensions()
105105
{
106106
// generate the base interface (either IVectorQuantity, IAffineQuantity or ILogarithmicQuantity)
@@ -158,7 +158,7 @@ private void GenerateInterfaceExtensions()
158158
IEquatable<{_quantity.Name}>,
159159
IFormattable");
160160
}
161-
161+
162162
private void GenerateQuantityInfo()
163163
{
164164
var quantityInfoClassName = $"{_quantity.Name}Info";
@@ -1081,7 +1081,7 @@ public double As(UnitSystem unitSystem)
10811081
else
10821082
{{
10831083
// No possible conversion
1084-
throw new NotImplementedException($""Can not convert {{Unit}} to {{unit}}."");
1084+
throw new UnitNotFoundException($""Can't convert {{Unit}} to {{unit}}."");
10851085
}}
10861086
}}
10871087

UnitsNet.NanoFramework/GeneratedCode/Quantities/AbsorbedDoseOfIonizingRadiation.g.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NanoFramework/GeneratedCode/Quantities/Acceleration.g.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NanoFramework/GeneratedCode/Quantities/AmountOfSubstance.g.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NanoFramework/GeneratedCode/Quantities/AmplitudeRatio.g.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NanoFramework/GeneratedCode/Quantities/Angle.g.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NanoFramework/GeneratedCode/Quantities/Area.g.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NanoFramework/GeneratedCode/Quantities/AreaDensity.g.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

UnitsNet.NanoFramework/GeneratedCode/Quantities/AreaMomentOfInertia.g.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)