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
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Swarmops.Common.Exceptions
{
public class DatabaseExecuteException: Exception
{
public DatabaseExecuteException(string attemptedCommand, Exception innerException = null)
{
if (String.IsNullOrEmpty(attemptedCommand))
{
throw new ArgumentNullException(attemptedCommand, "Parameter cannot be null or empty");
}
this.AttemptedCommand = attemptedCommand;
this.InnerException = innerException;
}
public string AttemptedCommand { get; }
public Exception InnerException { get; }
}
}