Skip to content

Commit

Permalink
Fixed error wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
evg4b committed Dec 25, 2022
1 parent bb1bec9 commit 21d928c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions internal/config/config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package config

import (
"fmt"

"github.com/evg4b/uncors/internal/middlewares/mock"
"github.com/spf13/pflag"
"github.com/spf13/viper"
Expand Down Expand Up @@ -33,16 +35,16 @@ func LoadConfiguration(viperInstance *viper.Viper) (*UncorsConfig, error) {
defineFlags()
pflag.Parse()
if err := viperInstance.BindPFlags(pflag.CommandLine); err != nil {
return nil, err
return nil, fmt.Errorf("filed parsing flags: %w", err)
}

configuration := &UncorsConfig{}
if err := viperInstance.Unmarshal(configuration); err != nil {
return nil, err
return nil, fmt.Errorf("filed parsing configuraion: %w", err)
}

if err := readURLMapping(viperInstance, configuration); err != nil {
return nil, err
return nil, fmt.Errorf("recognize url mapping: %w", err)
}

return configuration, nil
Expand Down
4 changes: 2 additions & 2 deletions internal/ui/last_version_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ type versionInfo struct {
Version string `json:"tag_name"`
}

func CheckLastVersion(client contracts.HTTPClient, reCurrentVersion string) {
func CheckLastVersion(client contracts.HTTPClient, rawCurrentVersion string) {
log.Debug("Checking new version")

currentVersion, err := version.NewVersion(reCurrentVersion)
currentVersion, err := version.NewVersion(rawCurrentVersion)
if err != nil {
log.Debugf("failed to parse current version: %v", err)

Expand Down

0 comments on commit 21d928c

Please sign in to comment.