beancount
    Preparing search index...

    Class BeancountParseError

    Custom error class for beancount parsing errors with location context

    Hierarchy

    • Error
      • BeancountParseError
    Index

    Constructors

    • Creates a new BeancountParseError with location context

      Parameters

      • options: {
            cause?: Error;
            location: SourceLocation;
            message: string;
            nodeType?: string;
            sourceContent: string[];
        }

        Error options

        • Optionalcause?: Error

          Original error that caused this error

        • location: SourceLocation

          Source location where error occurred

        • message: string

          Error message

        • OptionalnodeType?: string

          Type of node being parsed when error occurred

        • sourceContent: string[]

          Lines of source code where error occurred

      Returns BeancountParseError

    Properties

    location: SourceLocation
    nodeType?: string
    originalError: Error
    sourceContent: string[]

    Methods

    • Format the error with context lines and indicators

      Parameters

      • contextLinesBefore: number = 2

        Number of lines to show before error (default: 2)

      • contextLinesAfter: number = 2

        Number of lines to show after error (default: 2)

      Returns string

      Formatted error message with context

    • Override toString to provide formatted output

      Returns string

      Formatted error message with context