Documentation
¶
Index ¶
- func IsType(err error, errType ErrorType) bool
- type ErrorType
- type GoRAGError
- func ErrConfiguration(message string) *GoRAGError
- func ErrEmbedding(provider string, cause error) *GoRAGError
- func ErrInvalidInput(message string) *GoRAGError
- func ErrLLM(provider string, cause error) *GoRAGError
- func ErrNetwork(operation string, cause error) *GoRAGError
- func ErrParsing(format string, cause error) *GoRAGError
- func ErrRetrieval(cause error) *GoRAGError
- func ErrStorage(operation string, cause error) *GoRAGError
- func ErrTimeout(operation string, duration string) *GoRAGError
- func NewError(errType ErrorType, message string) *GoRAGError
- func Wrap(err error, errType ErrorType, message string) *GoRAGError
- func (e *GoRAGError) Error() string
- func (e *GoRAGError) Is(target error) bool
- func (e *GoRAGError) Unwrap() error
- func (e *GoRAGError) WithCause(cause error) *GoRAGError
- func (e *GoRAGError) WithContext(key string, value interface{}) *GoRAGError
- func (e *GoRAGError) WithContextMap(context map[string]interface{}) *GoRAGError
- func (e *GoRAGError) WithDocsURL(url string) *GoRAGError
- func (e *GoRAGError) WithSuggestion(suggestion string) *GoRAGError
- func (e *GoRAGError) WithSuggestions(suggestions ...string) *GoRAGError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrorType ¶
type ErrorType string
ErrorType represents the category of error
const ( // ErrorTypeInvalidInput indicates invalid input parameters ErrorTypeInvalidInput ErrorType = "invalid_input" // ErrorTypeParsing indicates document parsing errors ErrorTypeParsing ErrorType = "parsing" // ErrorTypeEmbedding indicates embedding generation errors ErrorTypeEmbedding ErrorType = "embedding" // ErrorTypeStorage indicates vector storage errors ErrorTypeStorage ErrorType = "storage" // ErrorTypeRetrieval indicates retrieval errors ErrorTypeRetrieval ErrorType = "retrieval" // ErrorTypeLLM indicates LLM client errors ErrorTypeLLM ErrorType = "llm" // ErrorTypeConfiguration indicates configuration errors ErrorTypeConfiguration ErrorType = "configuration" // ErrorTypeNetwork indicates network-related errors ErrorTypeNetwork ErrorType = "network" // ErrorTypeTimeout indicates timeout errors ErrorTypeTimeout ErrorType = "timeout" // ErrorTypeUnknown indicates unknown errors ErrorTypeUnknown ErrorType = "unknown" )
type GoRAGError ¶
type GoRAGError struct {
Type ErrorType // Error category
Message string // Error message
Cause error // Underlying error
Suggestions []string // Recovery suggestions
Context map[string]interface{} // Additional context
DocsURL string // Link to relevant documentation
}
GoRAGError represents a detailed error with context and suggestions
func ErrConfiguration ¶
func ErrConfiguration(message string) *GoRAGError
ErrConfiguration creates a configuration error
func ErrEmbedding ¶
func ErrEmbedding(provider string, cause error) *GoRAGError
ErrEmbedding creates an embedding error
func ErrInvalidInput ¶
func ErrInvalidInput(message string) *GoRAGError
ErrInvalidInput creates an invalid input error
func ErrNetwork ¶
func ErrNetwork(operation string, cause error) *GoRAGError
ErrNetwork creates a network error
func ErrParsing ¶
func ErrParsing(format string, cause error) *GoRAGError
ErrParsing creates a parsing error
func ErrRetrieval ¶
func ErrRetrieval(cause error) *GoRAGError
ErrRetrieval creates a retrieval error
func ErrStorage ¶
func ErrStorage(operation string, cause error) *GoRAGError
ErrStorage creates a storage error
func ErrTimeout ¶
func ErrTimeout(operation string, duration string) *GoRAGError
ErrTimeout creates a timeout error
func NewError ¶
func NewError(errType ErrorType, message string) *GoRAGError
NewError creates a new GoRAGError
func Wrap ¶
func Wrap(err error, errType ErrorType, message string) *GoRAGError
Wrap wraps an existing error with GoRAG error context
func (*GoRAGError) Is ¶
func (e *GoRAGError) Is(target error) bool
Is checks if the error matches the target error type
func (*GoRAGError) WithCause ¶
func (e *GoRAGError) WithCause(cause error) *GoRAGError
WithCause adds the underlying cause
func (*GoRAGError) WithContext ¶
func (e *GoRAGError) WithContext(key string, value interface{}) *GoRAGError
WithContext adds context information
func (*GoRAGError) WithContextMap ¶
func (e *GoRAGError) WithContextMap(context map[string]interface{}) *GoRAGError
WithContextMap adds multiple context entries
func (*GoRAGError) WithDocsURL ¶
func (e *GoRAGError) WithDocsURL(url string) *GoRAGError
WithDocsURL adds a documentation link
func (*GoRAGError) WithSuggestion ¶
func (e *GoRAGError) WithSuggestion(suggestion string) *GoRAGError
WithSuggestion adds a recovery suggestion
func (*GoRAGError) WithSuggestions ¶
func (e *GoRAGError) WithSuggestions(suggestions ...string) *GoRAGError
WithSuggestions adds multiple recovery suggestions