Skip to content
This repository has been archived by the owner on Sep 22, 2020. It is now read-only.

clean up errors in torusd #329

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

clean up errors in torusd #329

wants to merge 5 commits into from

Conversation

nak3
Copy link
Contributor

@nak3 nak3 commented Sep 22, 2016

No description provided.

@@ -223,8 +214,7 @@ func doAutojoin(s *torus.Server) error {
for {
ring, err := s.MDS.GetRing()
if err != nil {
fmt.Fprintf(os.Stderr, "couldn't get ring: %v\n", err)
return err
return errors.New(fmt.Sprintf("couldn't get ring: %v", err))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use fmt.Errorf

}
if err == torus.ErrExists {
// We're already a member; we're coming back up.
return nil
}
if err != nil {
fmt.Fprintf(os.Stderr, "couldn't add peer to ring: %v", err)
return err
return errors.New(fmt.Sprintf("couldn't add peer to ring: %v", err))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use fmt.Errorf

@nak3
Copy link
Contributor Author

nak3 commented Sep 23, 2016

Thank you. I updated.

@@ -163,24 +164,21 @@ func runServer(cmd *cobra.Command, args []string) {
if err == torus.ErrExists {
fmt.Println("debug-init: Already exists")
} else {
fmt.Printf("Couldn't debug-init: %s\n", err)
os.Exit(1)
return fmt.Errorf("Couldn't debug-init: %s", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could't ...

error msg should not start with capitalized letter.

@nak3
Copy link
Contributor Author

nak3 commented Dec 14, 2016

Thank you. I updated them and other messages as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants