mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-12-03 20:02:02 +00:00
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
24 lines
1.1 KiB
C#
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;
|
|
} |