Add exception handling to the DB classes

This commit is contained in:
Andreas Zweili 2018-08-04 11:48:10 +02:00
parent 548a1a6672
commit 61ee07375e
10 changed files with 71 additions and 41 deletions

View File

@ -28,8 +28,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
@ -46,8 +47,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
@ -64,10 +66,11 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
}
}
}

View File

@ -25,8 +25,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
@ -43,8 +44,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
@ -61,10 +63,11 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
}
}
}

View File

@ -30,8 +30,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
@ -48,8 +49,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
@ -66,10 +68,11 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
}
}
}

View File

@ -30,8 +30,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
@ -48,8 +49,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
@ -66,10 +68,11 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
}
}
}

View File

@ -29,8 +29,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
@ -47,8 +48,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
@ -65,10 +67,11 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
}
}
}

View File

@ -25,8 +25,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
@ -43,8 +44,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
@ -61,10 +63,11 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
}
}
}

View File

@ -5,7 +5,7 @@ using Server.Models;
namespace Server.DB
{
public class PatientAtFoodPlaceDB
public class PatientAtFoodPlaceDB
{
public ICollection<PatientAtFoodPlace> GetAllRelations()
{
@ -31,8 +31,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
@ -49,8 +50,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
@ -67,10 +69,11 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
}
}
}

View File

@ -31,8 +31,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
@ -49,8 +50,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
@ -67,10 +69,11 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
}
}
}

View File

@ -25,8 +25,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
@ -43,8 +44,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
@ -61,10 +63,11 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
}
}
}

View File

@ -25,8 +25,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
@ -43,8 +44,9 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
@ -61,10 +63,11 @@ namespace Server.DB
}
return true;
}
catch (Exception)
catch (Exception e)
{
System.Diagnostics.Trace.WriteLine(e.Message);
return false;
}
}
}
}
}