Skip to content

Commit

Permalink
Update docs and return a better error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Kassouf committed May 4, 2017
1 parent 55f1f51 commit 886f873
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion builtin/logical/database/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (b *databaseBackend) createDBObj(s logical.Storage, name string) (dbplugin.
func (b *databaseBackend) DatabaseConfig(s logical.Storage, name string) (*DatabaseConfig, error) {
entry, err := s.Get(fmt.Sprintf("config/%s", name))
if err != nil {
return nil, fmt.Errorf("failed to read connection configuration with name: %s", name)
return nil, fmt.Errorf("failed to read connection configuration: %s", err)

This comment has been minimized.

Copy link
@calvn

calvn May 4, 2017

Contributor

Would it make sense to include name as well (i.e. failed to read connection configuration: name: %s err: %s)?

This comment has been minimized.

Copy link
@briankassouf

briankassouf May 4, 2017

Contributor

I just figured if this is failing it's likely is independent of the entry we are retrieving (i.e. something is wrong with the storage backend) so there is no need to include it. If you think it should be in there though I can add it back

This comment has been minimized.

Copy link
@calvn

calvn May 4, 2017

Contributor

I see. I'm indifferent either way, up to you :)

}
if entry == nil {
return nil, fmt.Errorf("failed to find entry for connection with name: %s", name)
Expand Down
10 changes: 6 additions & 4 deletions website/source/api/secret/databases/index.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,13 @@ This endpoint creates or updates a role definition.
- `db_name` `(string: <required>)` - The name of the database connection to use
for this role.

- `default_ttl` `(string: <required>)` - Specifies the TTL for the lease
associated with this role.
- `default_ttl` `(string/int: 0)` - Specifies the TTL for the leases
associated with this role. Accepts time suffixed strings ("1h") or an integer
number of seconds. Defaults to system/backend default TTL time.

- `max_ttl` `(string: <required>)` - Specifies the maximum TTL for the lease
associated with this role.
- `max_ttl` `(string/int: 0)` - Specifies the maximum TTL for the leases
associated with this role. Accepts time suffixed strings ("1h") or an integer
number of seconds. Defaults to system/backend default TTL time.

- `creation_statements` `(string: <required>)` – Specifies the database
statements executed to create and configure a user. Must be a
Expand Down

0 comments on commit 886f873

Please sign in to comment.