Improved error handling a bit, need to update .aspx too

This commit is contained in:
Rick Falkvinge
2019-04-26 17:17:38 +02:00
parent 1a06ea3f65
commit eddc8da7b3
4 changed files with 57 additions and 6 deletions
+11 -1
View File
@@ -1,6 +1,8 @@
using System;
using System.Data;
using System.Data.Common;
using MySql.Data.MySqlClient;
using Swarmops.Common.Exceptions;
namespace Swarmops.Database
{
@@ -35,7 +37,15 @@ namespace Swarmops.Database
{
DbCommand command = GetDbCommand (sql, connection);
command.CommandType = CommandType.Text;
command.ExecuteNonQuery();
try
{
command.ExecuteNonQuery();
}
catch (MySqlException innerException)
{
throw new DatabaseExecuteException(sql, innerException);
}
}
}
}