Documentation
¶
Overview ¶
Package errorconfig defines types for structured error handling configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorCleanPattern = regexp.MustCompile(`[^a-zA-Z0-9./'"():=\- ]+`)
ErrorCleanPattern is used to clean error messages when looking for retry and ignore patterns.
Functions ¶
func ExtractErrorMessage ¶
ExtractErrorMessage extracts and cleans the error message for pattern matching.
func MatchesAnyRegexpPattern ¶
MatchesAnyRegexpPattern checks if the input string matches any of the provided compiled patterns.
Types ¶
type Action ¶
type Action struct {
IgnoreSignals map[string]any
IgnoreBlockName string
RetryBlockName string
IgnoreMessage string
RetryAttempts int
RetrySleepSecs int
ShouldIgnore bool
ShouldRetry bool
}
Action represents the action to take when an error occurs.
type Config ¶
type Config struct {
Retry map[string]*RetryConfig
Ignore map[string]*IgnoreConfig
}
Config is the extracted errors handling configuration.
type IgnoreConfig ¶
type IgnoreConfig struct {
Signals map[string]any
Name string
Message string
IgnorableErrors []*Pattern
}
IgnoreConfig represents the configuration for ignoring specific errors.
type MaxAttemptsReachedError ¶
MaxAttemptsReachedError is returned when the maximum number of retry attempts is reached.
func (*MaxAttemptsReachedError) Error ¶
func (e *MaxAttemptsReachedError) Error() string
Click to show internal directories.
Click to hide internal directories.