private static void fillElectricity(GarageLogic.Garage i_Garage) { Console.WriteLine("Please enter the vehicle licence number"); string licenceNumber = Console.ReadLine(); Console.WriteLine("Please enter amount of energy to fill in minutes"); float amountToFill; bool isElectric = true; while (!float.TryParse(Console.ReadLine(), out amountToFill)) { Console.WriteLine("Invalid amount. please insert valid amount."); } try { i_Garage.FillEnergyInVehicle(licenceNumber, amountToFill, isElectric); } catch (Exception ex) { catchExceptionAndContinue(i_Garage, ex); } }