mirror of
https://github.com/aykhans/dodo.git
synced 2025-09-09 04:20:46 +00:00
refactor error types
This commit is contained in:
@@ -141,7 +141,7 @@ func (parser ConfigFileParser) ParseYAML(data []byte) (*Config, error) {
|
||||
utils.OnCustomError(func(err types.RemoteConfigFileParseError) error {
|
||||
fieldParseErrors = append(
|
||||
fieldParseErrors,
|
||||
*types.NewFieldParseError(
|
||||
types.NewFieldParseError(
|
||||
fmt.Sprintf("config-file[%d]", i),
|
||||
configFile,
|
||||
fmt.Errorf("parse error: %w", err),
|
||||
@@ -160,7 +160,7 @@ func (parser ConfigFileParser) ParseYAML(data []byte) (*Config, error) {
|
||||
if parsedData.URL != nil {
|
||||
urlParsed, err := url.Parse(*parsedData.URL)
|
||||
if err != nil {
|
||||
fieldParseErrors = append(fieldParseErrors, *types.NewFieldParseError("url", *parsedData.URL, err))
|
||||
fieldParseErrors = append(fieldParseErrors, types.NewFieldParseError("url", *parsedData.URL, err))
|
||||
} else {
|
||||
config.URL = urlParsed
|
||||
}
|
||||
@@ -171,7 +171,7 @@ func (parser ConfigFileParser) ParseYAML(data []byte) (*Config, error) {
|
||||
if err != nil {
|
||||
fieldParseErrors = append(
|
||||
fieldParseErrors,
|
||||
*types.NewFieldParseError(fmt.Sprintf("proxy[%d]", i), proxy, err),
|
||||
types.NewFieldParseError(fmt.Sprintf("proxy[%d]", i), proxy, err),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user