public virtual void HandleException(Exception exception, DataSources datasource, IAdfQuery query)
{
LogManager.Log(exception);
if (exception is DBConcurrencyException)
{
ValidationManager.AddError("Adf.Data.UnderlyingDataChanged", query.LeadTable());
}
else if (exception is SqlException)
{
switch ((exception as SqlException).Number)
{
case 547:
ValidationManager.AddError("Adf.Data.ForeignKeyConstraintsViolated", query.LeadTable());
break;
case -2:
ValidationManager.AddError("Adf.Data.Timeout", query.LeadTable());
break;
default:
throw new DataException(exception.Message, exception);
}
}
else
{
throw new DataException(exception.Message, exception);
}
}