From a7f8039fba069a5da58ff2bfc294101f857b4344 Mon Sep 17 00:00:00 2001 From: Kenneth van Ewijk Date: Tue, 20 Oct 2015 11:18:03 +0200 Subject: [PATCH] Added more error handling --- ErgometerLibrary/NetHelper.cs | 12 +++++++++++- ErgometerLibrary/Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ErgometerLibrary/NetHelper.cs b/ErgometerLibrary/NetHelper.cs index ac944b8..3a3faf9 100644 --- a/ErgometerLibrary/NetHelper.cs +++ b/ErgometerLibrary/NetHelper.cs @@ -52,7 +52,17 @@ namespace ErgometerLibrary */ string str = ReadString(client); - NetCommand net = NetCommand.Parse(str); + NetCommand net; + if (str != "") + try { + net = NetCommand.Parse(str); + } + catch(Exception e) + { + net = new NetCommand(NetCommand.CommandType.ERROR, 0); + } + else + net = new NetCommand(NetCommand.CommandType.ERROR, 0); return net; } diff --git a/ErgometerLibrary/Properties/AssemblyInfo.cs b/ErgometerLibrary/Properties/AssemblyInfo.cs index 31cbfba..269ba2c 100644 --- a/ErgometerLibrary/Properties/AssemblyInfo.cs +++ b/ErgometerLibrary/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.3.1")] -[assembly: AssemblyFileVersion("1.0.3.1")] +[assembly: AssemblyVersion("1.0.3.5")] +[assembly: AssemblyFileVersion("1.0.3.5")]