namespace AIStudio.Tools.DocumentSegments;
///
/// The text of a document is larger than its format reads on this computer, see IDocumentSegmentFormat.MaxTextSize.
///
///
/// 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.
///
/// The document.
/// The size of the text of the document, in bytes, see IDocumentSegmentFormat.TextSizeOf.
/// The size of the largest text the format reads, in bytes.
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.")
{
///
/// The size of the text of the document, in bytes.
///
public long TextSize => textSize;
///
/// The size of the largest text the format reads, in bytes.
///
public long MaxTextSize => maxTextSize;
}