Skip to content

Commit dc6eca0

Browse files
committed
refactor: propagate the errors
1 parent 4e11b87 commit dc6eca0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/GetRemote.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func GetRemotes() (*Remotes, error) {
6262
func GetRemote(name string) (*Remote, error) {
6363
remotes, err := GetRemotes()
6464
if err != nil {
65-
return nil, fmt.Errorf("could not get remotes: %s", err.Error())
65+
return nil, fmt.Errorf("could not get remotes: %w", err)
6666
}
6767

6868
var remoteNames []string = make([]string, len(*remotes))

internal/GetUserConfigFile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func GetUserConfigFile(readOnly bool) (*os.File, error) {
2828

2929
userConfigFile, err := os.OpenFile(userConfigFilePath, fileAccessPermissions[readOnly], 0644)
3030
if err != nil {
31-
return nil, fmt.Errorf("error while trying to open your config file: %s", err.Error())
31+
return nil, fmt.Errorf("error while trying to open your config file: %w", err)
3232
}
3333

3434
return userConfigFile, nil

0 commit comments

Comments
 (0)