Skip to content

Commit 9727ad6

Browse files
committed
repo: improve error reporting when reading routes file
Print the error received by 'CreateRepository()'/'RemoveRoute()' when attempting to read the repository routes file. This will help users identify the cause of the failure (e.g., permissions issue) so it can be remedied. Signed-off-by: Victoria Dye <[email protected]>
1 parent 1f8d783 commit 9727ad6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/core/repo.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func CreateRepository(route string) (*Repository, error) {
2323
fs := common.NewFileSystem()
2424
repos, err := GetRepositories(user, fs)
2525
if err != nil {
26-
return nil, fmt.Errorf("failed to parse routes file")
26+
return nil, fmt.Errorf("failed to parse routes file: %w", err)
2727
}
2828

2929
repo, contains := repos[route]
@@ -63,7 +63,7 @@ func RemoveRoute(route string) error {
6363
fs := common.NewFileSystem()
6464
repos, err := GetRepositories(user, fs)
6565
if err != nil {
66-
return fmt.Errorf("failed to parse routes file")
66+
return fmt.Errorf("failed to parse routes file: %w", err)
6767
}
6868

6969
_, contains := repos[route]

0 commit comments

Comments
 (0)