Skip to content

Commit

Permalink
Wrap error message
Browse files Browse the repository at this point in the history
  • Loading branch information
smainz committed Jul 16, 2024
1 parent 528c331 commit 2bcfa47
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions cli/pipeline/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func pipelineLogs(c *cli.Context) error {
}
repoID, err := internal.ParseRepo(client, repoIDOrFullName)
if err != nil {
return fmt.Errorf("invalid repo-id or repo-full-name: '%s'", repoIDOrFullName)
return fmt.Errorf("invalid repo '%s': %w ", repoIDOrFullName, err)
}

pipelineArg := c.Args().Get(1)
Expand All @@ -51,7 +51,7 @@ func pipelineLogs(c *cli.Context) error {
}
number, err := strconv.ParseInt(pipelineArg, 10, 64)
if err != nil {
return fmt.Errorf("invalid pipeline '%s'", pipelineArg)
return fmt.Errorf("invalid pipeline '%s': %w", pipelineArg, err)
}

stepArg := c.Args().Get(2)
Expand All @@ -61,7 +61,7 @@ func pipelineLogs(c *cli.Context) error {

step, err := strconv.ParseInt(stepArg, 10, 64)
if err != nil {
return fmt.Errorf("invalid stepId '%s'", stepArg)
return fmt.Errorf("invalid stepId '%s': %w", stepArg, err)
}
return showStepLog(client, repoID, number, step)
}
Expand Down
4 changes: 2 additions & 2 deletions cli/pipeline/ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func pipelinePs(c *cli.Context) error {
}
repoID, err := internal.ParseRepo(client, repoIDOrFullName)
if err != nil {
return fmt.Errorf("invalid repo-id or repo-full-name: '%s'", repoIDOrFullName)
return fmt.Errorf("invalid repo '%s': %w", repoIDOrFullName, err)
}

pipelineArg := c.Args().Get(1)
Expand All @@ -65,7 +65,7 @@ func pipelinePs(c *cli.Context) error {
} else {
number, err = strconv.ParseInt(pipelineArg, 10, 64)
if err != nil {
return err
return fmt.Errorf("invalid pipeline '%s': %w", number, err)
}
}

Expand Down

0 comments on commit 2bcfa47

Please sign in to comment.