Container traits to extensions

This commit is contained in:
2023-08-03 10:48:39 +02:00
parent 86cffa6aa4
commit 558a0a08bb
32 changed files with 258 additions and 158 deletions

View File

@@ -8,25 +8,24 @@ public enum ItemNotFoundExceptionType
FullName,
NativePath
}
public class ItemNotFoundException : Exception
{
public string Path { get; }
public ItemNotFoundExceptionType Type { get; } = ItemNotFoundExceptionType.Raw;
public ItemNotFoundException(string path)
public ItemNotFoundException(string path) : base("Item not found " + path)
{
Path = path;
}
public ItemNotFoundException(FullName path)
public ItemNotFoundException(FullName path) : this(path.Path)
{
Path = path.Path;
Type = ItemNotFoundExceptionType.FullName;
}
public ItemNotFoundException(NativePath path)
public ItemNotFoundException(NativePath path) : this(path.Path)
{
Path = path.Path;
Type = ItemNotFoundExceptionType.NativePath;
}
}