коммит1
This commit is contained in:
parent
47cf7a6743
commit
baa9a24290
@ -1,24 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
|
||||
namespace ProjectTractor.Exceptions
|
||||
{
|
||||
[Serializable]
|
||||
internal class CarNotFoundException : ApplicationException
|
||||
{
|
||||
public CarNotFoundException(int i) : base($"Не найден объект по позиции { i}") { }
|
||||
public CarNotFoundException() : base() { }
|
||||
public CarNotFoundException(string message) : base(message) { }
|
||||
public CarNotFoundException(string message, Exception exception) :
|
||||
base(message, exception)
|
||||
{ }
|
||||
protected CarNotFoundException(SerializationInfo info,
|
||||
StreamingContext contex) : base(info, contex) { }
|
||||
}
|
||||
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
|
||||
namespace ProjectTractor.Exceptions
|
||||
{
|
||||
[Serializable]
|
||||
internal class StorageOverflowException : ApplicationException
|
||||
{
|
||||
public StorageOverflowException(int count) : base($"В наборе превышено допустимое количество: { count}") { }
|
||||
public StorageOverflowException() : base() { }
|
||||
public StorageOverflowException(string message) : base(message) { }
|
||||
public StorageOverflowException(string message, Exception exception)
|
||||
: base(message, exception) { }
|
||||
protected StorageOverflowException(SerializationInfo info,
|
||||
StreamingContext contex) : base(info, contex) { }
|
||||
}
|
||||
|
||||
}
|
@ -114,7 +114,7 @@ namespace ProjectTractor
|
||||
}
|
||||
if (data.Length == 0)
|
||||
{
|
||||
return false;
|
||||
throw new Exception("Невалидная операция, нет данных для сохранения");
|
||||
}
|
||||
using (StreamWriter streamWriter = new(filename))
|
||||
{
|
||||
@ -139,11 +139,11 @@ namespace ProjectTractor
|
||||
string[] strings = str.Split(new char[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (strings == null || strings.Length == 0)
|
||||
{
|
||||
return false;
|
||||
throw new IOException("Нет данных для загрузки");
|
||||
}
|
||||
if (!strings[0].StartsWith("TractorStorage"))
|
||||
{
|
||||
return false;
|
||||
throw new IOException("Неверный формат данных");
|
||||
}
|
||||
_tractorStorages.Clear();
|
||||
do
|
||||
@ -163,7 +163,7 @@ namespace ProjectTractor
|
||||
{
|
||||
if (!(collection + tractor))
|
||||
{
|
||||
return false;
|
||||
throw new ArgumentNullException("Ошибка добавления в коллекцию");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user