Skip to content

Commit

Permalink
Improve error message when template not found
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubno committed Aug 27, 2024
1 parent 347cb9e commit 41fc3a7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/shared/pkg/db/envs.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,6 @@ func (db *DB) GetEnvs(ctx context.Context, teamID uuid.UUID) (result []*Template
return result, nil
}

var ErrEnvNotFound = fmt.Errorf("env not found")

func (db *DB) GetEnv(ctx context.Context, aliasOrEnvID string) (result *Template, build *models.EnvBuild, err error) {
dbEnv, err := db.
Client.
Expand All @@ -102,7 +100,7 @@ func (db *DB) GetEnv(ctx context.Context, aliasOrEnvID string) (result *Template

notFound := models.IsNotFound(err)
if notFound {
return nil, nil, ErrEnvNotFound
return nil, nil, fmt.Errorf("template '%s' not found", aliasOrEnvID)
} else if err != nil {
return nil, nil, fmt.Errorf("failed to get env '%s': %w", aliasOrEnvID, err)
}
Expand Down

0 comments on commit 41fc3a7

Please sign in to comment.