Code development platform for open source projects from the European Union institutions :large_blue_circle: EU Login authentication by SMS has been phased out. To see alternatives please check here

Skip to content
Snippets Groups Projects
Commit 9c8e67c1 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

Retarder: changed from exception to switch-case

parent bbb800d2
No related branches found
No related tags found
No related merge requests found
...@@ -150,17 +150,13 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON ...@@ -150,17 +150,13 @@ namespace TUGraz.VectoCore.InputData.FileIO.JSON
get get
{ {
var retarderType = Body.GetEx(JsonKeys.Vehicle_Retarder).GetEx<string>(JsonKeys.Vehicle_Retarder_Type); var retarderType = Body.GetEx(JsonKeys.Vehicle_Retarder).GetEx<string>(JsonKeys.Vehicle_Retarder_Type);
try { switch (retarderType.ToLowerInvariant()) {
return retarderType.ParseEnum<RetarderType>();
} catch (Exception) {
switch (retarderType.ToLower()) {
case "primary": case "primary":
return RetarderType.TransmissionInputRetarder; return RetarderType.TransmissionInputRetarder;
case "secondary": case "secondary":
return RetarderType.TransmissionOutputRetarder; return RetarderType.TransmissionOutputRetarder;
default: default:
throw new VectoException("Unknown retarder type {0}", retarderType); return retarderType.ParseEnum<RetarderType>();
}
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment