Skip to content

Commit

Permalink
start errors with first small letter
Browse files Browse the repository at this point in the history
  • Loading branch information
ianic committed Nov 25, 2021
1 parent 20e27ea commit b7cfb73
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion cli/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func newStoreWithStage(stageName string) (*domain.FileStore, *domain.Stage, erro
}
stage := fs.Stage(stageName)
if stage == nil {
return nil, nil, log.Wrapf("Stage %s not found", stageName)
return nil, nil, log.Wrapf("stage %s not found", stageName)
}
addDefer(func() { log.SetStage(fs, project, stage) })
return fs, stage, nil
Expand Down
4 changes: 2 additions & 2 deletions cli/controller/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func createProject(name, from, moduleName string) error {
if errors.Is(err, git.ErrRepositoryNotFound) {
return log.Wrap(err, sourceNewUserError(repo))
}
return log.Wrap(err, "Could not initialize repository from source %s: %v", repo, err)
return log.Wrap(err, "could not initialize repository from source %s: %v", repo, err)

}
// delete LICENSE from template repositories
Expand Down Expand Up @@ -85,7 +85,7 @@ func repoURL(name, repo string) (string, error) {
if !isExternalRepo(repo) {
template := projectTemplate(repo)
if template == "" {
return "", log.Wrap(fmt.Errorf("invalid template %s", repo))
return "", log.Wrapf("invalid template %s", repo)

}
repo = TemplateRepos[template]
Expand Down
2 changes: 1 addition & 1 deletion cli/controller/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func uploadLogs(days int, url string) error {
}
defer rsp.Body.Close()
if rsp.StatusCode != 200 {
return log.Wrapf("non-ok status received from logs upload: %s", rsp.Status)
return log.Wrapf("logs upload failed with status: %s", rsp.Status)
}
return nil
}
Expand Down
9 changes: 4 additions & 5 deletions cli/controller/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func NewSetup(a *SetupArgs) (*Setup, error) {

func (c *Setup) Create(getPath func(string) (string, string)) error {
if !c.regionSupported() {
return log.Wrapf(`Mantil is currently not available in this region.
return log.Wrapf(`currently not available in this region
Available regions are:
+ %s`, strings.Join(supportedAWSRegions, "\n\t+ "))
}
Expand Down Expand Up @@ -169,8 +169,7 @@ func (c *Setup) createSetupStack(acf domain.NodeFunctions, suffix string) error
}
stackWaiter := c.aws.CloudFormation().CreateStack(c.stackName, string(t), c.resourceTags)
if err := runStackProgress("Installing setup stack", types.ResourceStatusCreateComplete, stackWaiter); err != nil {
log.Error(err)
return log.Wrapf("Installing setup stack failed. No resources were created in your AWS account.")
return log.Wrap(err, "installing setup stack failed")
}
// https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/919
if err := c.aws.TagLogGroup(aws.LambdaLogGroup(c.lambdaName), c.resourceTags); err != nil {
Expand All @@ -182,11 +181,11 @@ func (c *Setup) createSetupStack(acf domain.NodeFunctions, suffix string) error
func (c *Setup) Destroy() (bool, error) {
ws := c.store.Workspace()
if len(ws.Nodes) == 0 {
return false, log.Wrapf("Nothing to delete, there are no nodes installed in your workspace")
return false, log.Wrapf("nothing to delete, there are no nodes")
}
n := ws.Node(c.nodeName)
if n == nil {
return false, log.Wrapf("Node %s doesn't exist. For a complete list of available nodes run 'mantil aws ls'", c.nodeName)
return false, log.Wrapf("node %s doesn't exist\nFor a complete list of available nodes run 'mantil aws nodes'.", c.nodeName)
}
if !c.confirmDestroy(n) {
return false, nil
Expand Down
2 changes: 1 addition & 1 deletion cli/controller/stage.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func (s *Stage) List() error {
func (s *Stage) Use() error {
stage := s.project.Stage(s.Stage)
if stage == nil {
return log.Wrapf("Stage %s not found", s.Stage)
return log.Wrapf("stage %s not found", s.Stage)
}
s.project.SetDefaultStage(s.Stage)
if err := s.store.Store(); err != nil {
Expand Down

0 comments on commit b7cfb73

Please sign in to comment.