Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Remove fatal calls from sdk client creation #123

Merged
merged 1 commit into from
Sep 17, 2020
Merged

Remove fatal calls from sdk client creation #123

merged 1 commit into from
Sep 17, 2020

Conversation

cmoog
Copy link
Contributor

@cmoog cmoog commented Sep 5, 2020

Closes #114

@cmoog cmoog marked this pull request as ready for review September 8, 2020 21:23
@cmoog cmoog force-pushed the fix-fatal branch 3 times, most recently from 8337987 to 1594a12 Compare September 15, 2020 18:00
@cmoog cmoog requested a review from creack September 15, 2020 18:00
Copy link
Contributor

@creack creack left a comment

Choose a reason for hiding this comment

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

Might want to consider adding more wrapping, but lgtm. Big improvement!

if err != nil {
return err
}

absLocal, err := filepath.Abs(local)
if err != nil {
flog.Fatal("make abs path out of %v: %v", local, absLocal)
return xerrors.Errorf("make abs path out of %s: %s", local, absLocal)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: might want to add a %w with the underlying error?

@@ -95,7 +98,7 @@ func makeRunSync(init *bool) func(cmd *cobra.Command, args []string) error {
if rsyncErr != nil {
flog.Info("Unable to determine remote rsync version. Proceeding cautiously.")
} else if localVersion != remoteVersion {
flog.Fatal("rsync protocol mismatch: local = %v, remote = %v", localVersion, rsyncErr)
return xerrors.Errorf("rsync protocol mismatch: local = %s, remote = %s", localVersion, rsyncErr)
Copy link
Contributor

Choose a reason for hiding this comment

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

might want to remove rsyncErr here as we know it will be nil. I suspect it might have been a typo for remoteVersion?

@cmoog cmoog merged commit bf9a6ae into master Sep 17, 2020
@cmoog cmoog deleted the fix-fatal branch September 17, 2020 14:42
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.

Avoid fatal when checking for auth
2 participants