refactor error types

This commit is contained in:
2025-09-07 01:02:05 +04:00
parent 5cc13cfe7e
commit 896bb3ad2d
5 changed files with 25 additions and 25 deletions

View File

@@ -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),
)
}
}