Skip to content

Commit

Permalink
Cleanup some CLI error messages (#407)
Browse files Browse the repository at this point in the history
* Cleanup some CLI error messages
  • Loading branch information
phliar authored Oct 14, 2019
1 parent 1c68eb6 commit dd03803
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 13 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Changelog

## v3.4.10 (unreleased)
- Allow nil transform-function in EnsureaValidRangeConditions
## v3.4.11 (unreleased)
- (nothing changed yet)

## v3.4.10 (2019-10-14)
- Allow nil transform-function in EnsureValidRangeConditions
- Improve some CLI error messages

## v3.4.9 (2019-10-04)
- clarifying message on success of scope drop, to wait before re-creating
Expand Down
6 changes: 3 additions & 3 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func (c *client) Initialize(ctx context.Context) error {
// fetch latest version for all registered entities, assume order is preserved
version, err := c.connector.CheckSchema(ctx, c.registrar.Scope(), c.registrar.NamePrefix(), eds)
if err != nil {
return errors.Wrap(err, "CheckSchema failed")
return errors.Wrap(err, "schema on the server is incompatible with the code")
}

// set version for all registered entities
Expand Down Expand Up @@ -647,7 +647,7 @@ func (c *adminClient) CanUpsertSchema(ctx context.Context, namePrefix string) (*
}
version, err := c.connector.CanUpsertSchema(ctx, c.scope, namePrefix, defs)
if err != nil {
return nil, errors.Wrapf(err, "CheckSchema failed, directories: %s, excludes: %s, scope: %s", c.dirs, c.excludes, c.scope)
return nil, errors.Wrapf(err, "schema incompatible: directories: %s, excludes: %s, scope: %s", c.dirs, c.excludes, c.scope)
}
return &SchemaStatus{
Version: version,
Expand All @@ -658,7 +658,7 @@ func (c *adminClient) CanUpsertSchema(ctx context.Context, namePrefix string) (*
func (c *adminClient) CheckSchemaStatus(ctx context.Context, namePrefix string, version int32) (*SchemaStatus, error) {
status, err := c.connector.CheckSchemaStatus(ctx, c.scope, namePrefix, version)
if err != nil {
return nil, errors.Wrapf(err, "CheckSchemaStatus status failed")
return nil, errors.Wrapf(err, "check schema application status")
}
return status, nil
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/dosa/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func (c *shellQueryClient) Initialize(ctx context.Context) error {

version, err := c.connector.CheckSchema(ctx, registar.Scope(), registar.NamePrefix(), []*dosa.EntityDefinition{reg.EntityDefinition()})
if err != nil {
return errors.New("CheckSchema failed")
return errors.New("schema on the server is incompatible with the code")
}
reg.SetVersion(version)
return nil
Expand Down
6 changes: 3 additions & 3 deletions cmd/dosa/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ func (c *SchemaDump) doSchemaDumpInJavaClient() {
fmt.Printf("%s", out.String())
}

// expandDirectory verifies that each argument is actually a directory or
// expandDirectories verifies that each argument is actually a directory or
// uses the special go suffix of /... to mean recursively walk from here
// example: ./... means the current directory and all subdirectories
func expandDirectories(dirs []string) ([]string, error) {
Expand All @@ -422,12 +422,12 @@ func expandDirectories(dirs []string) ([]string, error) {
return nil
})
if err != nil {
return nil, err
return nil, errors.Wrapf(err, "couldn't walk %q", dir)
}
} else {
info, err := os.Stat(dir)
if err != nil {
return nil, err
return nil, errors.Wrapf(err, "%q does not exist", dir)
}
if !info.IsDir() {
return nil, fmt.Errorf("%q is not a directory", dir)
Expand Down
2 changes: 1 addition & 1 deletion cmd/dosa/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (c *ScopeCmd) doScopeOp(name string, f func(dosa.AdminClient, context.Conte
}
fmt.Printf("%s scope %q: OK\n", name, s)
if name == "drop" {
fmt.Println("\nPlease wait 10 minutes if you are going to re-create the scope with the same name.\n")
fmt.Print("\nPlease wait 10 minutes if you are going to re-create the scope with the same name.\n\n")
}
}
return nil
Expand Down
3 changes: 1 addition & 2 deletions mocks/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
package dosa

// VERSION indicates the dosa client version
const VERSION = "3.4.9"
const VERSION = "3.4.10"

0 comments on commit dd03803

Please sign in to comment.