mirror of
https://github.com/aykhans/dodo.git
synced 2025-09-09 20:40:47 +00:00
refactor error types
This commit is contained in:
@@ -174,7 +174,7 @@ func (parser ConfigCLIParser) Parse() (*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),
|
||||
@@ -198,7 +198,7 @@ func (parser ConfigCLIParser) Parse() (*Config, error) {
|
||||
case "url", "u":
|
||||
urlParsed, err := url.Parse(urlInput)
|
||||
if err != nil {
|
||||
fieldParseErrors = append(fieldParseErrors, *types.NewFieldParseError("url", urlInput, err))
|
||||
fieldParseErrors = append(fieldParseErrors, types.NewFieldParseError("url", urlInput, err))
|
||||
} else {
|
||||
config.URL = urlParsed
|
||||
}
|
||||
@@ -224,7 +224,7 @@ func (parser ConfigCLIParser) Parse() (*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