errors

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigError

type ConfigError struct {
	Field      string
	Value      string
	Underlying error
	Timestamp  time.Time
}

ConfigError represents a configuration error

func NewConfigError

func NewConfigError(field, value string, err error) *ConfigError

NewConfigError creates a new config error

func (*ConfigError) Error

func (e *ConfigError) Error() string

Error implements the error interface

func (*ConfigError) Unwrap

func (e *ConfigError) Unwrap() error

Unwrap returns the underlying error

type ErrorType

type ErrorType string

Error types for the lightning-code-index system

const (
	// Indexing errors
	ErrorTypeIndexing ErrorType = "indexing"
	ErrorTypeParse    ErrorType = "parse"
	ErrorTypeSearch   ErrorType = "search"

	// File errors
	ErrorTypeFileNotFound ErrorType = "file_not_found"
	ErrorTypeFileTooLarge ErrorType = "file_too_large"
	ErrorTypePermission   ErrorType = "permission"

	// Configuration errors
	ErrorTypeConfig ErrorType = "config"

	// Internal errors
	ErrorTypeInternal ErrorType = "internal"
)

type FileError

type FileError struct {
	Type       ErrorType
	Path       string
	Operation  string
	Underlying error
	Timestamp  time.Time
}

FileError represents a file-related error

func NewFileError

func NewFileError(op, path string, err error) *FileError

NewFileError creates a new file error

func (*FileError) Error

func (e *FileError) Error() string

Error implements the error interface

func (*FileError) Unwrap

func (e *FileError) Unwrap() error

Unwrap returns the underlying error

type IndexingError

type IndexingError struct {
	Type        ErrorType
	FileID      types.FileID
	FilePath    string
	Operation   string
	Underlying  error
	Timestamp   time.Time
	Recoverable bool
}

IndexingError represents an error during the indexing process

func NewIndexingError

func NewIndexingError(op string, err error) *IndexingError

NewIndexingError creates a new indexing error with context

func (*IndexingError) Error

func (e *IndexingError) Error() string

Error implements the error interface

func (*IndexingError) IsRecoverable

func (e *IndexingError) IsRecoverable() bool

IsRecoverable checks if the error can be retried

func (*IndexingError) Unwrap

func (e *IndexingError) Unwrap() error

Unwrap returns the underlying error for errors.Is/As

func (*IndexingError) WithFile

func (e *IndexingError) WithFile(fileID types.FileID, path string) *IndexingError

WithFile adds file information to the error

func (*IndexingError) WithRecoverable

func (e *IndexingError) WithRecoverable(recoverable bool) *IndexingError

WithRecoverable marks the error as recoverable

type MultiError

type MultiError struct {
	Errors []error
}

MultiError represents multiple errors

func NewMultiError

func NewMultiError(errs []error) *MultiError

NewMultiError creates a new multi-error

func (*MultiError) Error

func (e *MultiError) Error() string

Error implements the error interface

func (*MultiError) Unwrap

func (e *MultiError) Unwrap() []error

Unwrap returns all errors

type ParseError

type ParseError struct {
	Type       ErrorType
	FileID     types.FileID
	FilePath   string
	Line       int
	Column     int
	Token      string
	Underlying error
	Timestamp  time.Time
}

ParseError represents a parsing error

func NewParseError

func NewParseError(fileID types.FileID, path string, line, column int, token string, err error) *ParseError

NewParseError creates a new parse error

func (*ParseError) Error

func (e *ParseError) Error() string

Error implements the error interface

func (*ParseError) Unwrap

func (e *ParseError) Unwrap() error

Unwrap returns the underlying error

type SearchError

type SearchError struct {
	Type       ErrorType
	Pattern    string
	Underlying error
	Timestamp  time.Time
}

SearchError represents a search operation error

func NewSearchError

func NewSearchError(pattern string, err error) *SearchError

NewSearchError creates a new search error

func (*SearchError) Error

func (e *SearchError) Error() string

Error implements the error interface

func (*SearchError) Unwrap

func (e *SearchError) Unwrap() error

Unwrap returns the underlying error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL