Skip to content

Commit

Permalink
fix RP not found error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
dgnorton committed Nov 30, 2015
1 parent c9258a9 commit 9dd01a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/influxd/run/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ func TestServer_RetentionPolicyCommands(t *testing.T) {
&Query{
name: "Check error when deleting retention policy on non-existent database",
command: `DROP RETENTION POLICY rp1 ON mydatabase`,
exp: `{"results":[{"error":"database not found"}]}`,
exp: `{"results":[{"error":"database not found: mydatabase"}]}`,
},
},
}
Expand Down Expand Up @@ -1595,7 +1595,7 @@ func TestServer_Query_Common(t *testing.T) {
&Query{
name: "selecting a from a non-existent retention policy should error",
command: `SELECT value FROM db0.rp1.cpu`,
exp: `{"results":[{"error":"retention policy not found"}]}`,
exp: `{"results":[{"error":"retention policy not found: rp1"}]}`,
},
&Query{
name: "selecting a valid measurement and field should succeed",
Expand Down
8 changes: 4 additions & 4 deletions meta/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func (data *Data) ShardGroups(database, policy string) ([]ShardGroupInfo, error)
if err != nil {
return nil, err
} else if rpi == nil {
return nil, influxdb.ErrRetentionPolicyNotFound(database)
return nil, influxdb.ErrRetentionPolicyNotFound(policy)
}
groups := make([]ShardGroupInfo, 0, len(rpi.ShardGroups))
for _, g := range rpi.ShardGroups {
Expand All @@ -327,7 +327,7 @@ func (data *Data) ShardGroupsByTimeRange(database, policy string, tmin, tmax tim
if err != nil {
return nil, err
} else if rpi == nil {
return nil, influxdb.ErrRetentionPolicyNotFound(database)
return nil, influxdb.ErrRetentionPolicyNotFound(policy)
}
groups := make([]ShardGroupInfo, 0, len(rpi.ShardGroups))
for _, g := range rpi.ShardGroups {
Expand All @@ -346,7 +346,7 @@ func (data *Data) ShardGroupByTimestamp(database, policy string, timestamp time.
if err != nil {
return nil, err
} else if rpi == nil {
return nil, influxdb.ErrRetentionPolicyNotFound(database)
return nil, influxdb.ErrRetentionPolicyNotFound(policy)
}

return rpi.ShardGroupByTimestamp(timestamp), nil
Expand All @@ -364,7 +364,7 @@ func (data *Data) CreateShardGroup(database, policy string, timestamp time.Time)
if err != nil {
return err
} else if rpi == nil {
return influxdb.ErrRetentionPolicyNotFound(database)
return influxdb.ErrRetentionPolicyNotFound(policy)
}

// Verify that shard group doesn't already exist for this timestamp.
Expand Down

0 comments on commit 9dd01a9

Please sign in to comment.