Files
AI-Studio/app/MindWork AI Studio/Tools/DocumentSegments/DocumentTooLargeException.cs
T

24 lines
1.1 KiB
C#

namespace AIStudio.Tools.DocumentSegments;
/// <summary>
/// The text of a document is larger than its format reads on this computer, see IDocumentSegmentFormat.MaxTextSize.
/// </summary>
/// <remarks>
/// The format would hold the text in memory many times over while reading and writing it, so it refuses the document
/// before reading its text.
/// </remarks>
/// <param name="path">The document.</param>
/// <param name="textSize">The size of the text of the document, in bytes, see IDocumentSegmentFormat.TextSizeOf.</param>
/// <param name="maxTextSize">The size of the largest text the format reads, in bytes.</param>
public sealed class DocumentTooLargeException(string path, long textSize, long maxTextSize) : Exception($"The text of the document '{path}' takes {textSize} bytes, more than the {maxTextSize} bytes its format reads.")
{
/// <summary>
/// The size of the text of the document, in bytes.
/// </summary>
public long TextSize => textSize;
/// <summary>
/// The size of the largest text the format reads, in bytes.
/// </summary>
public long MaxTextSize => maxTextSize;
}