Skip to content

Commit

Permalink
making sure errors are wrapped
Browse files Browse the repository at this point in the history
  • Loading branch information
SUSTAPLE117 committed Sep 4, 2024
1 parent eb0379d commit 82d9d1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion analyze/analyze.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ func (a *Analyzer) cloneRepoToTemp(ctx context.Context, gitURL string, token str
err = a.GitClient.Clone(ctx, tempDir, gitURL, token, ref)
if err != nil {
os.RemoveAll(tempDir) // Clean up if cloning fails
return "", fmt.Errorf("failed to clone repo: %s", err)
return "", fmt.Errorf("failed to clone repo: %w", err)
}
return tempDir, nil
}
Expand Down
2 changes: 1 addition & 1 deletion providers/gitlab/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ type Client struct {
func NewClient(ctx context.Context, baseUrl string, token string) (*Client, error) {
gitlabClient, err := gitlab.NewClient(token, gitlab.WithBaseURL(fmt.Sprintf("https://%s", baseUrl)))
if err != nil {
return nil, fmt.Errorf("failed to create gitlab client: %v", err)
return nil, fmt.Errorf("failed to create gitlab client: %w", err)
}
return &Client{
Token: token,
Expand Down

0 comments on commit 82d9d1c

Please sign in to comment.